From 8fe532748af57d65b592171f00760b27c36fd847 Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Mon, 4 Mar 2024 03:38:31 +0800 Subject: [PATCH] Do not adapt lights that are turned on with an effect (#844) * Do not adapt lights that are turned on with an effect * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bas Nijholt --- 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 cf38d21f..23ca14f9 100644 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -2654,7 +2654,10 @@ class AdaptiveLightingManager: 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