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 Changes
This commit is contained in:
parent
9fc8a8f679
commit
0f2cfe7f27
1 changed files with 6 additions and 1 deletions
|
@ -204,7 +204,12 @@ class FluxLight(Light):
|
||||||
self._bulb.turnOn()
|
self._bulb.turnOn()
|
||||||
|
|
||||||
hs_color = kwargs.get(ATTR_HS_COLOR)
|
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)
|
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||||
effect = kwargs.get(ATTR_EFFECT)
|
effect = kwargs.get(ATTR_EFFECT)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue