Cancel transition timers when the last profile unloads (#1567)

This commit is contained in:
Bas Nijholt 2026-09-06 17:20:07 +02:00 • committed by GitHub
commit 1d50165eb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 51 additions and 1 deletions

View file

@ -1878,12 +1878,15 @@ class AdaptiveLightingManager:
)
def disable(self) -> None:
"""Disable listeners and pending automatic manual-control resets."""
"""Disable listeners and pending manual-reset and transition timers."""
for remove in self.listener_removers:
remove()
for timer in self.auto_reset_manual_control_timers.values():
timer.cancel()
self.auto_reset_manual_control_timers.clear()
for timer in self.transition_timers.values():
timer.cancel()
self.transition_timers.clear()
def set_proactively_adapting(self, context_id: str, entity_id: str) -> None:
"""Declare the adaptation with context_id as proactively adapting,