Trim CW from RGB when not supported in ozw (#39191)
* Trim the CW value if CW isn't supported * Trim CW from white level as well
This commit is contained in:
parent
2e8506de80
commit
7462d140af
2 changed files with 11 additions and 6 deletions
|
@ -204,12 +204,17 @@ class ZwaveLight(ZWaveDeviceEntity, LightEntity):
|
|||
rgbw = "#"
|
||||
for colorval in color_util.color_hs_to_RGB(*hs_color):
|
||||
rgbw += f"{colorval:02x}"
|
||||
rgbw += "0000"
|
||||
if self._color_channels and self._color_channels & COLOR_CHANNEL_COLD_WHITE:
|
||||
rgbw += "0000"
|
||||
else:
|
||||
# trim the CW value or it will not work correctly
|
||||
rgbw += "00"
|
||||
# white LED must be off in order for color to work
|
||||
|
||||
elif white is not None:
|
||||
if self._color_channels & COLOR_CHANNEL_WARM_WHITE:
|
||||
rgbw = f"#000000{white:02x}00"
|
||||
# trim the CW value or it will not work correctly
|
||||
rgbw = f"#000000{white:02x}"
|
||||
else:
|
||||
rgbw = f"#00000000{white:02x}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue