Merge remote-tracking branch 'origin/master' into dev

* origin/master:
  Fix issue in Timer thread caused by variable name.
  Fix issue with some bulbs missing 'xy' attribute.
This commit is contained in:
Paulus Schoutsen 2015-02-21 18:24:10 -08:00
commit b5a3a72b51
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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