Using alert with Hue maintains prior state (#3147)
* When using flash with hue, dont change the on/off state of the light so that it will naturally return to its previous state once flash is complete * ATTR_FLASH not ATTR_EFFECT
This commit is contained in:
1 parent
22362727e4
commit
0f37d8d8eb
3 files changed
+20
No files matched your search
@@ -264,8 +264,10 @@ class HueLight(Light):
|
||||
|
||||
if flash == FLASH_LONG:
|
||||
command['alert'] = 'lselect'
|
||||
del command['on']
|
||||
elif flash == FLASH_SHORT:
|
||||
command['alert'] = 'select'
|
||||
del command['on']
|
||||
elif self.bridge_type == 'hue':
|
||||
command['alert'] = 'none'
|
||||
|
||||
@@ -290,6 +292,17 @@ class HueLight(Light):
|
||||
# 900 seconds.
|
||||
command['transitiontime'] = min(9000, kwargs[ATTR_TRANSITION] * 10)
|
||||
|
||||
flash = kwargs.get(ATTR_FLASH)
|
||||
|
||||
if flash == FLASH_LONG:
|
||||
command['alert'] = 'lselect'
|
||||
del command['on']
|
||||
elif flash == FLASH_SHORT:
|
||||
command['alert'] = 'select'
|
||||
del command['on']
|
||||
elif self.bridge_type == 'hue':
|
||||
command['alert'] = 'none'
|
||||
|
||||
self.bridge.set_light(self.light_id, command)
|
||||
|
||||
def update(self):
|
||||
|
||||
Reference in new issue
Block a user