From 2575f4ec30dd9fe3b6cf4493530beb8519d940d5 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Thu, 20 Jul 2023 17:12:41 -0700 Subject: [PATCH] Only adapt if switch if on in _service_interceptor_turn_on_handler (#642) * Do not adapt if switch is off in _service_interceptor_turn_on_handler * Bump to 1.16.1 --- custom_components/adaptive_lighting/manifest.json | 2 +- custom_components/adaptive_lighting/switch.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/manifest.json b/custom_components/adaptive_lighting/manifest.json index edb27fe8..91be72a6 100644 --- a/custom_components/adaptive_lighting/manifest.json +++ b/custom_components/adaptive_lighting/manifest.json @@ -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" } diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 2bc17862..e5a031c6 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -1817,6 +1817,9 @@ class TurnOnOffListener: # 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