mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Remove check
This commit is contained in:
parent
1e559905bc
commit
39fd8f2be0
1 changed files with 5 additions and 15 deletions
|
|
@ -1268,25 +1268,15 @@ 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
|
||||
|
||||
if context.parent_id is not None and self.manager.is_proactively_adapting(
|
||||
context.parent_id,
|
||||
):
|
||||
# Skip if adaptation was already executed by the service call interceptor.
|
||||
# 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.
|
||||
_LOGGER.debug(
|
||||
"%s: Skipping reactive adaptation of light %s with context.id=%s and context.parent_id=%s",
|
||||
self._name,
|
||||
light,
|
||||
context.id,
|
||||
context.parent_id,
|
||||
)
|
||||
return
|
||||
|
||||
data = await self.prepare_adaptation_data(
|
||||
light,
|
||||
transition,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue