Fix color setting in LIFX services (#49822)
This commit is contained in:
parent
ff137fe186
commit
21872c42fe
1 changed files with 6 additions and 0 deletions
|
@ -200,6 +200,12 @@ def find_hsbk(hass, **kwargs):
|
|||
|
||||
if ATTR_HS_COLOR in kwargs:
|
||||
hue, saturation = kwargs[ATTR_HS_COLOR]
|
||||
elif ATTR_RGB_COLOR in kwargs:
|
||||
hue, saturation = color_util.color_RGB_to_hs(*kwargs[ATTR_RGB_COLOR])
|
||||
elif ATTR_XY_COLOR in kwargs:
|
||||
hue, saturation = color_util.color_xy_to_hs(*kwargs[ATTR_XY_COLOR])
|
||||
|
||||
if hue is not None:
|
||||
hue = int(hue / 360 * 65535)
|
||||
saturation = int(saturation / 100 * 65535)
|
||||
kelvin = 3500
|
||||
|
|
Loading…
Add table
Reference in a new issue