better log

This commit is contained in:
Bas Nijholt 2023-07-31 17:56:24 -07:00
commit ddd2dc59cd

View file

@ -1277,8 +1277,10 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
):
# Skip if adaptation was already executed by the service call interceptor
_LOGGER.debug(
"%s: Skipping reactive adaptation of %s",
"%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
@ -1490,9 +1492,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
)
self.manager.mark_as_manual_control(entity_id)
return
# TODO: I believe I need to separate the concept of random turn ons and # noqa: TD002, FIX002, TD003
# manual control because take_over_control can be False which means that
# manual control is ignored. Or deprecate take_over_contol and make it always True?
if self._adapt_delay > 0:
await asyncio.sleep(self._adapt_delay)