From 0f2cfe7f2760a32ed287e1de0d9fe30f2e3e6b7e Mon Sep 17 00:00:00 2001 From: dramamoose Date: Fri, 30 Mar 2018 15:10:25 -0600 Subject: [PATCH] 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 --- homeassistant/components/light/flux_led.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/flux_led.py b/homeassistant/components/light/flux_led.py index ed0836f1449..6ffdcc0bb4a 100644 --- a/homeassistant/components/light/flux_led.py +++ b/homeassistant/components/light/flux_led.py @@ -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)