Update deCONZ to use new state classes (#54729)
parent
789e6555cc
commit
4c5d5a8f5a
|
@ -17,6 +17,7 @@ from pydeconz.sensor import (
|
|||
from homeassistant.components.sensor import (
|
||||
DOMAIN,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
STATE_CLASS_TOTAL_INCREASING,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
|
@ -41,7 +42,6 @@ from homeassistant.helpers.dispatcher import (
|
|||
async_dispatcher_connect,
|
||||
async_dispatcher_send,
|
||||
)
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
|
||||
from .deconz_device import DeconzDevice
|
||||
|
@ -68,7 +68,7 @@ ICON = {
|
|||
}
|
||||
|
||||
STATE_CLASS = {
|
||||
Consumption: STATE_CLASS_MEASUREMENT,
|
||||
Consumption: STATE_CLASS_TOTAL_INCREASING,
|
||||
Humidity: STATE_CLASS_MEASUREMENT,
|
||||
Pressure: STATE_CLASS_MEASUREMENT,
|
||||
Temperature: STATE_CLASS_MEASUREMENT,
|
||||
|
@ -164,9 +164,6 @@ class DeconzSensor(DeconzDevice, SensorEntity):
|
|||
type(self._device)
|
||||
)
|
||||
|
||||
if device.type in Consumption.ZHATYPE:
|
||||
self._attr_last_reset = dt_util.utc_from_timestamp(0)
|
||||
|
||||
@callback
|
||||
def async_update_callback(self, force_update=False):
|
||||
"""Update the sensor's state."""
|
||||
|
|
Loading…
Reference in New Issue