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 <basnijholt@gmail.com>
This commit is contained in:
Jonathan Kang 2024-03-04 03:38:31 +08:00 committed by GitHub
commit 8fe532748a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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