mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add warning when entity not found in reproduce_state
This commit is contained in:
parent
95eabe7c0e
commit
5af1643297
@ -51,6 +51,8 @@ def reproduce_state(hass, states, blocking=False):
|
|||||||
current_state = hass.states.get(state.entity_id)
|
current_state = hass.states.get(state.entity_id)
|
||||||
|
|
||||||
if current_state is None:
|
if current_state is None:
|
||||||
|
_LOGGER.warning('reproduce_state: Unable to find entity %s',
|
||||||
|
state.entity_id)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if state.state == STATE_ON:
|
if state.state == STATE_ON:
|
||||||
@ -58,7 +60,8 @@ def reproduce_state(hass, states, blocking=False):
|
|||||||
elif state.state == STATE_OFF:
|
elif state.state == STATE_OFF:
|
||||||
service = SERVICE_TURN_OFF
|
service = SERVICE_TURN_OFF
|
||||||
else:
|
else:
|
||||||
_LOGGER.warning("Unable to reproduce state for %s", state)
|
_LOGGER.warning("reproduce_state: Unable to reproduce state %s",
|
||||||
|
state)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
service_data = dict(state.attributes)
|
service_data = dict(state.attributes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user