Improve WLED pure white support for RGBW (#30477)

This commit is contained in:
Franck Nijhof
2020-01-04 22:52:10 +01:00
committed by Paulus Schoutsen
parent 51db9bdfce
commit 4e62da9c8e
2 changed files with 22 additions and 0 deletions
+5
View File
@@ -191,6 +191,11 @@ class WLEDLight(Light, WLEDDeviceEntity):
hue, sat = self._color
data[ATTR_COLOR_PRIMARY] = color_util.color_hsv_to_RGB(hue, sat, 100)
# On a RGBW strip, when the color is pure white, disable the RGB LEDs in
# WLED by setting RGB to 0,0,0
if data[ATTR_COLOR_PRIMARY] == (255, 255, 255):
data[ATTR_COLOR_PRIMARY] = (0, 0, 0)
# Add requested or last known white value
if ATTR_WHITE_VALUE in kwargs:
data[ATTR_COLOR_PRIMARY] += (kwargs[ATTR_WHITE_VALUE],)