deCONZ use forward entry setup (#13990)

* Use forward entry setup with light platform

* Move sensor to forward entry setup

* Use forward entry setup with binary sensors

* Use forward entry setup with scene platform

* Remove import of unused functionality

* Move deconz setup in to setup entry
Create initial negative tests for setup entry

* Fix hound comment

* Improved tests

* Add test for scene platform

* Add test for binary sensor platform

* Add test for light platform

* Add test for light platform

* Add test for sensor platform

* Fix hound comment

* More asserts on sensor types
This commit is contained in:
Kane610 authored and Paulus Schoutsen committed 2018-04-23 12:00:16 -04:00
1 parent 5fe4053021
commit 8a10fcd985
13 files changed
+358 -36

No files matched your search

+6 -1
View File
@@ -31,8 +31,13 @@ DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
async def async_setup(hass, config):
"""Track states and offer events for sensors."""
component = EntityComponent(
component = hass.data[DOMAIN] = EntityComponent(
_LOGGER, DOMAIN, hass, SCAN_INTERVAL)
await component.async_setup(config)
return True
async def async_setup_entry(hass, entry):
"""Setup a config entry."""
return await hass.data[DOMAIN].async_setup_entry(entry)
+5 -3
View File
@@ -22,10 +22,12 @@ ATTR_EVENT_ID = 'event_id'
async def async_setup_platform(hass, config, async_add_devices,
discovery_info=None):
"""Set up the deCONZ sensors."""
if discovery_info is None:
return
"""Old way of setting up deCONZ sensors."""
pass
async def async_setup_entry(hass, config_entry, async_add_devices):
"""Set up the deCONZ sensors."""
from pydeconz.sensor import DECONZ_SENSOR, SWITCH as DECONZ_REMOTE
sensors = hass.data[DATA_DECONZ].sensors
entities = []