diff --git a/homeassistant/__init__.py b/homeassistant/__init__.py index 304d7060418..354898c0319 100644 --- a/homeassistant/__init__.py +++ b/homeassistant/__init__.py @@ -780,7 +780,7 @@ class Timer(threading.Thread): self.daemon = True self.hass = hass self.interval = interval or TIMER_INTERVAL - self._stop = threading.Event() + self._stop_event = threading.Event() # We want to be able to fire every time a minute starts (seconds=0). # We want this so other modules can use that to make sure they fire @@ -794,7 +794,7 @@ class Timer(threading.Thread): """ Start the timer. """ self.hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, - lambda event: self._stop.set()) + lambda event: self._stop_event.set()) _LOGGER.info("Timer:starting") @@ -803,7 +803,7 @@ class Timer(threading.Thread): calc_now = dt.datetime.now interval = self.interval - while not self._stop.isSet(): + while not self._stop_event.isSet(): now = calc_now() # First check checks if we are not on a second matching the 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