docs: clarify comment for light group turn_on check

Update the comment at line 2832 to accurately reflect that this check
handles light groups when context IDs don't match. The primary fix for
#1378 (matching context IDs) is handled earlier in the context ID
match block.
This commit is contained in:
Bas Nijholt 2026-01-13 03:43:45 -08:00
commit 8466e3c29c

View file

@ -2830,9 +2830,8 @@ class AdaptiveLightingManager:
transition = None
# Check if the off→on state change was triggered by a light.turn_on call.
# This check now also handles light groups: if a member light was turned on
# after the group turned off, the group's turn-on is considered valid.
# See: https://github.com/basnijholt/adaptive-lighting/issues/1378
# For light groups, this also checks if a member's turn_on explains the
# group's turn-on (handles cases where context IDs don't match).
if self._off_to_on_state_event_is_from_turn_on(entity_id, off_to_on_event):
is_toggle = off_to_on_event == self.toggle_event.get(entity_id)
from_service = "light.toggle" if is_toggle else "light.turn_on"