LIFX: add support for setting infrared level (#8000)

* LIFX: update aiolifx

This adds support for infrared and multizone.

* LIFX: add support for infrared
This commit is contained in:
Anders Melchiorsen 2017-06-11 22:38:07 +02:00 committed by GitHub
parent 9e16be3173
commit 314bce1073
3 changed files with 11 additions and 2 deletions

View File

@ -34,7 +34,7 @@ from . import effects as lifx_effects
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['aiolifx==0.4.7']
REQUIREMENTS = ['aiolifx==0.4.8']
UDP_BROADCAST_PORT = 56700
@ -46,6 +46,7 @@ CONF_SERVER = 'server'
SERVICE_LIFX_SET_STATE = 'lifx_set_state'
ATTR_HSBK = 'hsbk'
ATTR_INFRARED = 'infrared'
ATTR_POWER = 'power'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@ -53,6 +54,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
LIFX_SET_STATE_SCHEMA = LIGHT_TURN_ON_SCHEMA.extend({
ATTR_INFRARED: vol.All(vol.Coerce(int), vol.Clamp(min=0, max=255)),
ATTR_POWER: cv.boolean,
})
@ -363,6 +365,9 @@ class LIFXLight(Light):
yield from lifx_effects.default_effect(self, **kwargs)
return
if ATTR_INFRARED in kwargs:
self.device.set_infrared(convert_8_to_16(kwargs[ATTR_INFRARED]))
if ATTR_TRANSITION in kwargs:
fade = int(kwargs[ATTR_TRANSITION] * 1000)
else:

View File

@ -9,6 +9,10 @@ lifx_set_state:
'...':
description: All turn_on parameters can be used to specify a color
infrared:
description: Automatic infrared level (0..255) when light brightness is low
example: 255
transition:
description: Duration in seconds it takes to get to the final state
example: 10

View File

@ -49,7 +49,7 @@ aiodns==1.1.1
aiohttp_cors==0.5.3
# homeassistant.components.light.lifx
aiolifx==0.4.7
aiolifx==0.4.8
# homeassistant.components.scene.hunterdouglas_powerview
aiopvapi==1.4