WIP deCONZ - Support Fyrtur/Kadrilj battery sensors (#30403)

* Sensor.binary is None means unsupported sensor
* Don't create ordinary sensor on ZHABattery type
This commit is contained in:
Robert Svensson 2020-01-03 15:15:32 +01:00 committed by GitHub
parent 0d5486f772
commit 536b201472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 5 deletions

View File

@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/deconz",
"requirements": [
"pydeconz==66"
"pydeconz==67"
],
"ssdp": [
{

View File

@ -1,5 +1,13 @@
"""Support for deCONZ sensors."""
from pydeconz.sensor import Consumption, Daylight, LightLevel, Power, Switch, Thermostat
from pydeconz.sensor import (
Battery,
Consumption,
Daylight,
LightLevel,
Power,
Switch,
Thermostat,
)
from homeassistant.const import ATTR_TEMPERATURE, ATTR_VOLTAGE, DEVICE_CLASS_BATTERY
from homeassistant.core import callback
@ -53,7 +61,11 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
hass.async_create_task(new_event.async_update_device_registry())
gateway.events.append(new_event)
elif new and not sensor.BINARY and sensor.type not in Thermostat.ZHATYPE:
elif (
new
and sensor.BINARY is False
and sensor.type not in Battery.ZHATYPE + Thermostat.ZHATYPE
):
new_sensor = DeconzSensor(sensor, gateway)
entity_handler.add_entity(new_sensor)

View File

@ -1191,7 +1191,7 @@ pydaikin==1.6.1
pydanfossair==0.1.0
# homeassistant.components.deconz
pydeconz==66
pydeconz==67
# homeassistant.components.delijn
pydelijn==0.5.1

View File

@ -411,7 +411,7 @@ pycoolmasternet==0.0.4
pydaikin==1.6.1
# homeassistant.components.deconz
pydeconz==66
pydeconz==67
# homeassistant.components.zwave
pydispatcher==2.0.5