Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
* origin/master:
  Fix issue in Timer thread caused by variable name.
  Fix issue with some bulbs missing 'xy' attribute.
  • Loading branch information
balloob committed Feb 22, 2015
2 parents 24d9856 + cfb7b83 commit b5a3a72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions homeassistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ def __init__(self, hass, interval=None):
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
Expand All @@ -794,7 +794,7 @@ def run(self):
""" 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")

Expand All @@ -803,7 +803,7 @@ def run(self):
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
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/light/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def state_attributes(self):

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

Expand Down

0 comments on commit b5a3a72

Please sign in to comment.