mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 16:24:04 +02:00
Update switch.py
This commit is contained in:
parent
6e9fb0cc0d
commit
6b2fbf7c9b
1 changed files with 3 additions and 3 deletions
|
|
@ -1129,11 +1129,8 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
)
|
||||
self.async_write_ha_state()
|
||||
|
||||
# Return here if there's no lights to adapt.
|
||||
if lights is None:
|
||||
lights = self._lights
|
||||
if not len(lights):
|
||||
return
|
||||
|
||||
if not force:
|
||||
if self._only_once:
|
||||
|
|
@ -1142,6 +1139,9 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
# Don't adapt lights that haven't finished prior transitions.
|
||||
if self.turn_on_off_listener.transition_timers.get(light):
|
||||
lights.remove(light)
|
||||
if not len(lights):
|
||||
return
|
||||
|
||||
await self._update_manual_control_and_maybe_adapt(
|
||||
lights, transition, force, context
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue