mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-15 16:24:04 +02:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
22f3a2b4de
commit
6bf89603e2
1 changed files with 14 additions and 13 deletions
|
|
@ -768,21 +768,22 @@ def _attributes_have_changed(
|
|||
)
|
||||
return True
|
||||
|
||||
if (
|
||||
adapt_color
|
||||
and (
|
||||
(
|
||||
old_attributes.get(ATTR_COLOR_TEMP_KELVIN)
|
||||
and not new_attributes.get(ATTR_COLOR_TEMP_KELVIN)
|
||||
)
|
||||
or (
|
||||
old_attributes.get(ATTR_RGB_COLOR)
|
||||
and not new_attributes.get(ATTR_RGB_COLOR)
|
||||
)
|
||||
if adapt_color and (
|
||||
(
|
||||
old_attributes.get(ATTR_COLOR_TEMP_KELVIN)
|
||||
and not new_attributes.get(ATTR_COLOR_TEMP_KELVIN)
|
||||
)
|
||||
or (
|
||||
old_attributes.get(ATTR_RGB_COLOR)
|
||||
and not new_attributes.get(ATTR_RGB_COLOR)
|
||||
)
|
||||
):
|
||||
last_mode = "color_temp" if old_attributes.get(ATTR_COLOR_TEMP_KELVIN) else "rgb"
|
||||
current_mode = "color_temp" if new_attributes.get(ATTR_COLOR_TEMP_KELVIN) else "rgb"
|
||||
last_mode = (
|
||||
"color_temp" if old_attributes.get(ATTR_COLOR_TEMP_KELVIN) else "rgb"
|
||||
)
|
||||
current_mode = (
|
||||
"color_temp" if new_attributes.get(ATTR_COLOR_TEMP_KELVIN) else "rgb"
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"Light mode of %s changed from %s to %s with context.id='%s'",
|
||||
light,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue