From a80447f096a4c70c739c29f20c83367b66240783 Mon Sep 17 00:00:00 2001 From: yanuino <36410910+yanuino@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:32:04 +0100 Subject: [PATCH] Use state class enum for DHT (#60916) --- homeassistant/components/dht/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/dht/sensor.py b/homeassistant/components/dht/sensor.py index 810db33e5e4..7c4ae5610f7 100644 --- a/homeassistant/components/dht/sensor.py +++ b/homeassistant/components/dht/sensor.py @@ -12,6 +12,7 @@ from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.const import ( CONF_MONITORED_CONDITIONS, @@ -44,12 +45,14 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( name="Temperature", native_unit_of_measurement=TEMP_CELSIUS, device_class=DEVICE_CLASS_TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=SENSOR_HUMIDITY, name="Humidity", native_unit_of_measurement=PERCENTAGE, device_class=DEVICE_CLASS_HUMIDITY, + state_class=SensorStateClass.MEASUREMENT, ), )