mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix: Hue lights will not flash anymore on next turn on call after having flashed
This commit is contained in:
parent
99447eaa17
commit
6044742cee
@ -7,7 +7,8 @@ import homeassistant.util as util
|
|||||||
from homeassistant.helpers import ToggleDevice
|
from homeassistant.helpers import ToggleDevice
|
||||||
from homeassistant.const import ATTR_FRIENDLY_NAME, CONF_HOST
|
from homeassistant.const import ATTR_FRIENDLY_NAME, CONF_HOST
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS, ATTR_XY_COLOR, ATTR_TRANSITION, ATTR_FLASH, FLASH_LONG)
|
ATTR_BRIGHTNESS, ATTR_XY_COLOR, ATTR_TRANSITION,
|
||||||
|
ATTR_FLASH, FLASH_LONG, FLASH_SHORT)
|
||||||
|
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(seconds=1)
|
MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(seconds=1)
|
||||||
@ -97,8 +98,12 @@ class HueLight(ToggleDevice):
|
|||||||
|
|
||||||
flash = kwargs.get(ATTR_FLASH)
|
flash = kwargs.get(ATTR_FLASH)
|
||||||
|
|
||||||
if flash is not None:
|
if flash == FLASH_LONG:
|
||||||
command['alert'] = 'lselect' if flash == FLASH_LONG else 'select'
|
command['alert'] = 'lselect'
|
||||||
|
elif flash == FLASH_SHORT:
|
||||||
|
command['alert'] = 'select'
|
||||||
|
else:
|
||||||
|
command['alert'] = 'none'
|
||||||
|
|
||||||
self.bridge.set_light(self.light_id, command)
|
self.bridge.set_light(self.light_id, command)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user