Skip to content

Commit

Permalink
Test that switch is on before updating time listeners (#936)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Carroll <[email protected]>
  • Loading branch information
droans and droans authored Feb 21, 2024
1 parent bc8c940 commit 92aa504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/adaptive_lighting/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ async def handle_change_switch_settings(

# deep copy the defaults so we don't modify the original dicts
switch._set_changeable_settings(data=data, defaults=deepcopy(defaults))
switch._update_time_interval_listener()
if switch.is_on:
switch._update_time_interval_listener()

_LOGGER.debug(
"Called 'adaptive_lighting.change_switch_settings' service with '%s'",
Expand Down

0 comments on commit 92aa504

Please sign in to comment.