Add Deconz support for Zigbee green power devices like Hue Tap (#11455)

* Add support for Zigbee green power devices such as the Hue Tap

* Clarify that imported SWITCH is a DECONZ_REMOTE
This commit is contained in:
Kane610 2018-01-15 10:47:55 +01:00 committed by Martin Hjelmare
parent f86b645417
commit 3979387c80
3 changed files with 4 additions and 5 deletions

View file

@ -17,7 +17,6 @@ from homeassistant.util import slugify
DEPENDENCIES = ['deconz']
ATTR_EVENT_ID = 'event_id'
ATTR_ZHASWITCH = 'ZHASwitch'
@asyncio.coroutine
@ -26,13 +25,13 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
if discovery_info is None:
return
from pydeconz.sensor import DECONZ_SENSOR
from pydeconz.sensor import DECONZ_SENSOR, SWITCH as DECONZ_REMOTE
sensors = hass.data[DECONZ_DATA].sensors
entities = []
for sensor in sensors.values():
if sensor.type in DECONZ_SENSOR:
if sensor.type == ATTR_ZHASWITCH:
if sensor.type in DECONZ_REMOTE:
DeconzEvent(hass, sensor)
if sensor.battery:
entities.append(DeconzBattery(sensor))