mirror of
https://github.com/home-assistant/core.git
synced 2025-05-01 12:47:53 +00:00
Only turn off the specified lights
This commit is contained in:
parent
69a616a0ba
commit
1c1d075c12
@ -147,7 +147,7 @@ def setup(hass, config):
|
|||||||
break
|
break
|
||||||
|
|
||||||
# Did all devices leave the house?
|
# Did all devices leave the house?
|
||||||
elif (entity == device_tracker.ENTITY_ID_ALL_DEVICES and
|
elif (entity == device_group and
|
||||||
new_state.state == STATE_NOT_HOME and lights_are_on
|
new_state.state == STATE_NOT_HOME and lights_are_on
|
||||||
and not disable_turn_off):
|
and not disable_turn_off):
|
||||||
|
|
||||||
@ -163,8 +163,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
# Track when all devices are gone to shut down lights
|
# Track when all devices are gone to shut down lights
|
||||||
hass.states.track_change(
|
hass.states.track_change(
|
||||||
device_tracker.ENTITY_ID_ALL_DEVICES,
|
device_group, check_light_on_dev_state_change,
|
||||||
check_light_on_dev_state_change,
|
|
||||||
STATE_HOME, STATE_NOT_HOME)
|
STATE_HOME, STATE_NOT_HOME)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user