From c3155651e4aad6714852b87cd18a4acfc65c03e6 Mon Sep 17 00:00:00 2001 From: andythigpen Date: Sat, 21 Feb 2015 15:02:08 -0600 Subject: [PATCH] Fix issue with some bulbs missing 'xy' attribute. Philips Lux bulbs (as well as other dimmable bulbs that work with the Hue hub) do not have an 'xy' attribute. --- homeassistant/components/light/hue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index 6efce68d031..e53fd1fa25d 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -159,7 +159,8 @@ class HueLight(ToggleDevice): if self.is_on: attr[ATTR_BRIGHTNESS] = self.info['state']['bri'] - attr[ATTR_XY_COLOR] = self.info['state']['xy'] + if 'xy' in self.info['state']: + attr[ATTR_XY_COLOR] = self.info['state']['xy'] return attr