Require take_over_control for to ignore non-turn_on state off -> on event (#695)

This commit is contained in:
Bas Nijholt 2023-08-02 17:59:44 -07:00 committed by GitHub
commit 807f7109d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1465,7 +1465,8 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
async def _respond_to_off_to_on_event(self, entity_id: str, event: Event) -> None:
assert not self.manager.is_proactively_adapting(event.context.id)
if (
not self._detect_non_ha_changes
self._take_over_control
and not self._detect_non_ha_changes
and not self.manager._off_to_on_state_event_is_from_turn_on(
entity_id,
event,