Guard Z-Wave light HS conversion on None (#31320)

pull/30697/head^2
Paulus Schoutsen 2020-01-30 11:13:54 -08:00 committed by GitHub
parent 9432054066
commit d6d3feb54e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -380,7 +380,9 @@ class ZwaveColorLight(ZwaveDimmer):
# white LED must be off in order for color to work
self._white = 0
if ATTR_WHITE_VALUE in kwargs or ATTR_HS_COLOR in kwargs:
if (
ATTR_WHITE_VALUE in kwargs or ATTR_HS_COLOR in kwargs
) and self._hs is not None:
rgbw = "#"
for colorval in color_util.color_hs_to_RGB(*self._hs):
rgbw += format(colorval, "02x")