mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-27 12:24:19 +02:00
Normalize turn-off transitions during light recovery
This commit is contained in:
parent
c2d9ea3e51
commit
bd6e724030
2 changed files with 26 additions and 1 deletions
|
|
@ -2948,7 +2948,7 @@ class AdaptiveLightingManager:
|
|||
turn_off = self.turn_off_event.get(entity_id)
|
||||
if turn_off is None:
|
||||
return False
|
||||
transition = turn_off.data[ATTR_SERVICE_DATA].get(ATTR_TRANSITION)
|
||||
transition = _turn_off_transition(turn_off)
|
||||
elapsed = (dt_util.utcnow() - turn_off.time_fired).total_seconds()
|
||||
if not 0 <= elapsed <= max(transition or 0, TURNING_OFF_DELAY):
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue