mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
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
c361b0c450
commit
f40efe0110
@ -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)
|
||||||
|
|
||||||
|
if hs_color:
|
||||||
rgb = color_util.color_hs_to_RGB(*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…
x
Reference in New Issue
Block a user