mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix LIFX color conversions (#12957)
This commit is contained in:
parent
b04e7bba9f
commit
c462292e4d
@ -169,15 +169,15 @@ def find_hsbk(**kwargs):
|
|||||||
if ATTR_RGB_COLOR in kwargs:
|
if ATTR_RGB_COLOR in kwargs:
|
||||||
hue, saturation, brightness = \
|
hue, saturation, brightness = \
|
||||||
color_util.color_RGB_to_hsv(*kwargs[ATTR_RGB_COLOR])
|
color_util.color_RGB_to_hsv(*kwargs[ATTR_RGB_COLOR])
|
||||||
hue = hue / 360 * 65535
|
hue = int(hue / 360 * 65535)
|
||||||
saturation = saturation / 100 * 65535
|
saturation = int(saturation / 100 * 65535)
|
||||||
brightness = brightness / 100 * 65535
|
brightness = int(brightness / 100 * 65535)
|
||||||
kelvin = 3500
|
kelvin = 3500
|
||||||
|
|
||||||
if ATTR_XY_COLOR in kwargs:
|
if ATTR_XY_COLOR in kwargs:
|
||||||
hue, saturation = color_util.color_xy_to_hs(*kwargs[ATTR_XY_COLOR])
|
hue, saturation = color_util.color_xy_to_hs(*kwargs[ATTR_XY_COLOR])
|
||||||
hue = hue / 360 * 65535
|
hue = int(hue / 360 * 65535)
|
||||||
saturation = saturation / 100 * 65535
|
saturation = int(saturation / 100 * 65535)
|
||||||
kelvin = 3500
|
kelvin = 3500
|
||||||
|
|
||||||
if ATTR_COLOR_TEMP in kwargs:
|
if ATTR_COLOR_TEMP in kwargs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user