Skip to content

Commit

Permalink
Only adapt if switch if on in _service_interceptor_turn_on_handler (#642
Browse files Browse the repository at this point in the history
)

* Do not adapt if switch is off in _service_interceptor_turn_on_handler

* Bump to 1.16.1
  • Loading branch information
basnijholt authored Jul 21, 2023
1 parent 6c001b4 commit 2575f4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/adaptive_lighting/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "calculated",
"issue_tracker": "https://github.com/basnijholt/adaptive-lighting/issues",
"requirements": ["ulid-transform"],
"version": "1.16.0"
"version": "1.16.1"
}
3 changes: 3 additions & 0 deletions custom_components/adaptive_lighting/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,9 @@ async def _service_interceptor_turn_on_handler(
# This might be a light that is not managed by this AL instance.
return

if not adaptive_switch.is_on:
return

if entity_id not in adaptive_switch.lights:
return

Expand Down

0 comments on commit 2575f4e

Please sign in to comment.