don't break the chain
This commit is contained in:
parent
8d42e42230
commit
efdd0c9e8a
1 changed files with 7 additions and 8 deletions
|
@ -61,15 +61,14 @@ def reproduce_state(hass, states, blocking=False):
|
||||||
service = SERVICE_MEDIA_PAUSE
|
service = SERVICE_MEDIA_PAUSE
|
||||||
elif state.domain == 'media_player' and state == STATE_PLAYING:
|
elif state.domain == 'media_player' and state == STATE_PLAYING:
|
||||||
service = SERVICE_MEDIA_PLAY
|
service = SERVICE_MEDIA_PLAY
|
||||||
|
elif state.state == STATE_ON:
|
||||||
|
service = SERVICE_TURN_ON
|
||||||
|
elif state.state == STATE_OFF:
|
||||||
|
service = SERVICE_TURN_OFF
|
||||||
else:
|
else:
|
||||||
if state.state == STATE_ON:
|
_LOGGER.warning("reproduce_state: Unable to reproduce state %s",
|
||||||
service = SERVICE_TURN_ON
|
state)
|
||||||
elif state.state == STATE_OFF:
|
continue
|
||||||
service = SERVICE_TURN_OFF
|
|
||||||
else:
|
|
||||||
_LOGGER.warning("reproduce_state: Unable to reproduce \
|
|
||||||
state %s", state)
|
|
||||||
continue
|
|
||||||
|
|
||||||
service_data = dict(state.attributes)
|
service_data = dict(state.attributes)
|
||||||
service_data[ATTR_ENTITY_ID] = state.entity_id
|
service_data[ATTR_ENTITY_ID] = state.entity_id
|
||||||
|
|
Loading…
Add table
Reference in a new issue