Fix LIFX color conversions (#12957)

This commit is contained in:
Anders Melchiorsen 2018-03-07 05:55:04 +01:00 committed by GitHub
parent b04e7bba9f
commit c462292e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,15 +169,15 @@ def find_hsbk(**kwargs):
if ATTR_RGB_COLOR in kwargs:
hue, saturation, brightness = \
color_util.color_RGB_to_hsv(*kwargs[ATTR_RGB_COLOR])
hue = hue / 360 * 65535
saturation = saturation / 100 * 65535
brightness = brightness / 100 * 65535
hue = int(hue / 360 * 65535)
saturation = int(saturation / 100 * 65535)
brightness = int(brightness / 100 * 65535)
kelvin = 3500
if ATTR_XY_COLOR in kwargs:
hue, saturation = color_util.color_xy_to_hs(*kwargs[ATTR_XY_COLOR])
hue = hue / 360 * 65535
saturation = saturation / 100 * 65535
hue = int(hue / 360 * 65535)
saturation = int(saturation / 100 * 65535)
kelvin = 3500
if ATTR_COLOR_TEMP in kwargs: