Deconz use entity registry (#12067)

* Support for entity registry

* Not everything is a sensor...
This commit is contained in:
Kane610 2018-01-30 23:42:24 +01:00 committed by Paulus Schoutsen
parent 990fbdf3ca
commit 37034a7450
5 changed files with 23 additions and 3 deletions

View file

@ -65,6 +65,11 @@ class DeconzBinarySensor(BinarySensorDevice):
"""Return the name of the sensor."""
return self._sensor.name
@property
def unique_id(self):
"""Return a unique identifier for this sensor."""
return self._sensor.uniqueid
@property
def device_class(self):
"""Return the class of the sensor."""

View file

@ -17,7 +17,7 @@ from homeassistant.helpers import discovery
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util.json import load_json, save_json
REQUIREMENTS = ['pydeconz==25']
REQUIREMENTS = ['pydeconz==27']
_LOGGER = logging.getLogger(__name__)
@ -38,7 +38,7 @@ SERVICE_DATA = 'data'
SERVICE_SCHEMA = vol.Schema({
vol.Required(SERVICE_FIELD): cv.string,
vol.Required(SERVICE_DATA): cv.string,
vol.Required(SERVICE_DATA): dict,
})
CONFIG_INSTRUCTIONS = """

View file

@ -100,6 +100,11 @@ class DeconzLight(Light):
"""Return the name of the light."""
return self._light.name
@property
def unique_id(self):
"""Return a unique identifier for this light."""
return self._light.uniqueid
@property
def supported_features(self):
"""Flag supported features."""

View file

@ -74,6 +74,11 @@ class DeconzSensor(Entity):
"""Return the name of the sensor."""
return self._sensor.name
@property
def unique_id(self):
"""Return a unique identifier for this sensor."""
return self._sensor.uniqueid
@property
def device_class(self):
"""Return the class of the sensor."""
@ -139,6 +144,11 @@ class DeconzBattery(Entity):
"""Return the name of the battery."""
return self._name
@property
def unique_id(self):
"""Return a unique identifier for the device."""
return self._device.uniqueid
@property
def device_class(self):
"""Return the class of the sensor."""

View file

@ -687,7 +687,7 @@ pycsspeechtts==1.0.2
pydaikin==0.4
# homeassistant.components.deconz
pydeconz==25
pydeconz==27
# homeassistant.components.zwave
pydispatcher==2.0.5