Fix FLUX_LED error when no color is set (#13527)
* Handle turn_on situation when no color is set As is, an error gets thrown when turn_on is called without an HS value. By adding an if statement, we only try to set RGB if an HS value is applied. * Fix Whitespace Issues * Made Requested Changespull/13554/head
parent
9fc8a8f679
commit
0f2cfe7f27
|
@ -204,7 +204,12 @@ class FluxLight(Light):
|
|||
self._bulb.turnOn()
|
||||
|
||||
hs_color = kwargs.get(ATTR_HS_COLOR)
|
||||
rgb = color_util.color_hs_to_RGB(*hs_color)
|
||||
|
||||
if hs_color:
|
||||
rgb = color_util.color_hs_to_RGB(*hs_color)
|
||||
else:
|
||||
rgb = None
|
||||
|
||||
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||
effect = kwargs.get(ATTR_EFFECT)
|
||||
|
||||
|
|
Loading…
Reference in New Issue