From 1572a8a53b3a9d410fdd1ac8acc6c4101bf1df4c Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Wed, 15 Nov 2023 16:54:40 +0800 Subject: [PATCH 1/2] Do not adapt lights that are turned on with an effect --- custom_components/adaptive_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 7e910525..fd202374 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -2648,7 +2648,7 @@ def _mark_manual_control_if_non_bare_turn_on( entity_id, service_data, ) - if any(attr in service_data for attr in COLOR_ATTRS | BRIGHTNESS_ATTRS): + if any(attr in service_data for attr in COLOR_ATTRS | BRIGHTNESS_ATTRS | {ATTR_EFFECT}): self.mark_as_manual_control(entity_id) return True return False From e2402dd8d30f3e39f726e3c6ad345f0f3ebaea97 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:39:19 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- custom_components/adaptive_lighting/switch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index fd202374..dd523ab7 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -2648,7 +2648,10 @@ def _mark_manual_control_if_non_bare_turn_on( entity_id, service_data, ) - if any(attr in service_data for attr in COLOR_ATTRS | BRIGHTNESS_ATTRS | {ATTR_EFFECT}): + if any( + attr in service_data + for attr in COLOR_ATTRS | BRIGHTNESS_ATTRS | {ATTR_EFFECT} + ): self.mark_as_manual_control(entity_id) return True return False