mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Mark as manually controlled when using flash, effect, or RGBW(W) (#684)
* Mark as manually controlled when using flash or effect * Add comment * Add RGBW and RGBWW
This commit is contained in:
parent
68985199f6
commit
2b35ee1e5e
2 changed files with 13 additions and 2 deletions
|
|
@ -13,6 +13,8 @@ from homeassistant.components.light import (
|
|||
ATTR_COLOR_TEMP_KELVIN,
|
||||
ATTR_HS_COLOR,
|
||||
ATTR_RGB_COLOR,
|
||||
ATTR_RGBW_COLOR,
|
||||
ATTR_RGBWW_COLOR,
|
||||
ATTR_TRANSITION,
|
||||
ATTR_XY_COLOR,
|
||||
)
|
||||
|
|
@ -27,8 +29,11 @@ COLOR_ATTRS = { # Should ATTR_PROFILE be in here?
|
|||
ATTR_HS_COLOR,
|
||||
ATTR_RGB_COLOR,
|
||||
ATTR_XY_COLOR,
|
||||
ATTR_RGBW_COLOR,
|
||||
ATTR_RGBWW_COLOR,
|
||||
}
|
||||
|
||||
|
||||
BRIGHTNESS_ATTRS = {
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_BRIGHTNESS_PCT,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ import voluptuous as vol
|
|||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_COLOR_TEMP_KELVIN,
|
||||
ATTR_EFFECT,
|
||||
ATTR_FLASH,
|
||||
ATTR_RGB_COLOR,
|
||||
ATTR_SUPPORTED_COLOR_MODES,
|
||||
ATTR_TRANSITION,
|
||||
|
|
@ -1450,6 +1452,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
context.id,
|
||||
)
|
||||
else:
|
||||
# Need to fire manual control event because of significant_change
|
||||
_fire_manual_control_event(self, light, context)
|
||||
else:
|
||||
_LOGGER.debug(
|
||||
|
|
@ -2371,8 +2374,11 @@ class AdaptiveLightingManager:
|
|||
and not force
|
||||
):
|
||||
keys = turn_on_event.data[ATTR_SERVICE_DATA].keys()
|
||||
if (adapt_color and COLOR_ATTRS.intersection(keys)) or (
|
||||
adapt_brightness and BRIGHTNESS_ATTRS.intersection(keys)
|
||||
if (
|
||||
(adapt_color and COLOR_ATTRS.intersection(keys))
|
||||
or (adapt_brightness and BRIGHTNESS_ATTRS.intersection(keys))
|
||||
or (ATTR_FLASH in keys)
|
||||
or (ATTR_EFFECT in keys)
|
||||
):
|
||||
# Light was already on and 'light.turn_on' was not called by
|
||||
# the adaptive_lighting integration.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue