mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 00:04:05 +02:00
Comments
This commit is contained in:
parent
645b262ced
commit
8a16c9fb03
1 changed files with 1 additions and 6 deletions
|
|
@ -1269,11 +1269,6 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
adapt_color: bool | None = None,
|
||||
prefer_rgb_color: bool | None = None,
|
||||
) -> None:
|
||||
# This should never happen if it's been proactively adapted.
|
||||
# The context.parent_id is the context.id of the service call that was intercepted
|
||||
# and context.id here is from the resulting "light_event" event.
|
||||
assert not self.manager.is_proactively_adapting(context.parent_id)
|
||||
|
||||
if (lock := self.manager.turn_off_locks.get(light)) and lock.locked():
|
||||
_LOGGER.debug("%s: '%s' is locked", self._name, light)
|
||||
return
|
||||
|
|
@ -2050,12 +2045,12 @@ class AdaptiveLightingManager:
|
|||
continue
|
||||
|
||||
for eid in filtered_entity_ids:
|
||||
# Must add a new context otherwise _adapt_light will bail out
|
||||
context = switch.create_context("intercept")
|
||||
self.clear_proactively_adapting(eid)
|
||||
self.set_proactively_adapting(context.id, eid)
|
||||
await switch._adapt_light(
|
||||
light=eid,
|
||||
# Must add a new context otherwise _adapt_light will bail out
|
||||
context=context,
|
||||
transition=transition,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue