From 2220df5a3ea313eef2ee3e9a591db91aa68adf51 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 25 Nov 2014 21:38:47 -0800 Subject: [PATCH] Better light.xy_color parsing --- homeassistant/components/light/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 54099600287..30a221cbaeb 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -262,7 +262,8 @@ def setup(hass, config): # xy_color should be a list containing 2 floats xycolor = dat.get(ATTR_XY_COLOR) - if len(xycolor) == 2: + # Without this check, a xycolor with value '99' would work + if not isinstance(xycolor, str): params[ATTR_XY_COLOR] = [float(val) for val in xycolor] except (TypeError, ValueError):