mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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:
parent
0d5486f772
commit
536b201472
@ -4,7 +4,7 @@
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/deconz",
|
||||
"requirements": [
|
||||
"pydeconz==66"
|
||||
"pydeconz==67"
|
||||
],
|
||||
"ssdp": [
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user