mirror of
https://github.com/home-assistant/core.git
synced 2025-05-09 16:39:22 +00:00
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:
commit
b5a3a72b51
homeassistant
@ -780,7 +780,7 @@ class Timer(threading.Thread):
|
|||||||
self.daemon = True
|
self.daemon = True
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.interval = interval or TIMER_INTERVAL
|
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 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
|
# 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. """
|
""" Start the timer. """
|
||||||
|
|
||||||
self.hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP,
|
self.hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP,
|
||||||
lambda event: self._stop.set())
|
lambda event: self._stop_event.set())
|
||||||
|
|
||||||
_LOGGER.info("Timer:starting")
|
_LOGGER.info("Timer:starting")
|
||||||
|
|
||||||
@ -803,7 +803,7 @@ class Timer(threading.Thread):
|
|||||||
calc_now = dt.datetime.now
|
calc_now = dt.datetime.now
|
||||||
interval = self.interval
|
interval = self.interval
|
||||||
|
|
||||||
while not self._stop.isSet():
|
while not self._stop_event.isSet():
|
||||||
now = calc_now()
|
now = calc_now()
|
||||||
|
|
||||||
# First check checks if we are not on a second matching the
|
# First check checks if we are not on a second matching the
|
||||||
|
@ -159,6 +159,7 @@ class HueLight(ToggleDevice):
|
|||||||
|
|
||||||
if self.is_on:
|
if self.is_on:
|
||||||
attr[ATTR_BRIGHTNESS] = self.info['state']['bri']
|
attr[ATTR_BRIGHTNESS] = self.info['state']['bri']
|
||||||
|
if 'xy' in self.info['state']:
|
||||||
attr[ATTR_XY_COLOR] = self.info['state']['xy']
|
attr[ATTR_XY_COLOR] = self.info['state']['xy']
|
||||||
|
|
||||||
return attr
|
return attr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user