deCONZ thermostat support (#20586)

* Add support for thermostats in deCONZ by adding Climate platform
This commit is contained in:
Robert Svensson 2019-02-18 17:43:22 +01:00 committed by GitHub
parent 3f9e6a7064
commit 9ce8f4737d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 347 additions and 35 deletions

View file

@ -9,8 +9,8 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
import homeassistant.util.color as color_util
from .const import (
CONF_ALLOW_DECONZ_GROUPS, DOMAIN as DECONZ_DOMAIN, COVER_TYPES,
SWITCH_TYPES)
CONF_ALLOW_DECONZ_GROUPS, DOMAIN as DECONZ_DOMAIN, COVER_TYPES, NEW_GROUP,
NEW_LIGHT, SWITCH_TYPES)
from .deconz_device import DeconzDevice
DEPENDENCIES = ['deconz']
@ -36,7 +36,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
gateway.listeners.append(
async_dispatcher_connect(hass, 'deconz_new_light', async_add_light))
async_dispatcher_connect(hass, NEW_LIGHT, async_add_light))
@callback
def async_add_group(groups):
@ -49,7 +49,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
gateway.listeners.append(
async_dispatcher_connect(hass, 'deconz_new_group', async_add_group))
async_dispatcher_connect(hass, NEW_GROUP, async_add_group))
async_add_light(gateway.api.lights.values())
async_add_group(gateway.api.groups.values())