mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +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
|
||||
|
||||
# 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
|
||||
and not disable_turn_off):
|
||||
|
||||
@ -163,8 +163,7 @@ def setup(hass, config):
|
||||
|
||||
# Track when all devices are gone to shut down lights
|
||||
hass.states.track_change(
|
||||
device_tracker.ENTITY_ID_ALL_DEVICES,
|
||||
check_light_on_dev_state_change,
|
||||
device_group, check_light_on_dev_state_change,
|
||||
STATE_HOME, STATE_NOT_HOME)
|
||||
|
||||
return True
|
||||
|
Loading…
x
Reference in New Issue
Block a user