mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 06:44:04 +02:00
Take care of the turn_on_event not having registered an event for entity_id
This commit is contained in:
parent
f049c8d5db
commit
dee6eed67f
1 changed files with 5 additions and 0 deletions
|
|
@ -1512,6 +1512,11 @@ class TurnOnOffListener:
|
|||
transition = None
|
||||
|
||||
turn_on_event = self.turn_on_event.get(entity_id)
|
||||
if turn_on_event is None:
|
||||
# This means that the light never got a 'turn_on' call that we
|
||||
# registered. I am not 100% sure why this happens, but it does.
|
||||
# This is a fix for #170 and #232
|
||||
return False
|
||||
id_turn_on = turn_on_event.context.id
|
||||
|
||||
id_off_to_on = off_to_on_event.context.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue