From 2601d71f5df2ac959d6a053ba069c0ef3346fcef Mon Sep 17 00:00:00 2001 From: David Le Brun Date: Thu, 14 Oct 2021 23:15:16 +0200 Subject: [PATCH] Add state_class to EnOcean sensors (#57666) --- homeassistant/components/enocean/sensor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/enocean/sensor.py b/homeassistant/components/enocean/sensor.py index ccf01eec448..ca0f5e95109 100644 --- a/homeassistant/components/enocean/sensor.py +++ b/homeassistant/components/enocean/sensor.py @@ -5,6 +5,7 @@ import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, + STATE_CLASS_MEASUREMENT, SensorEntity, SensorEntityDescription, ) @@ -44,6 +45,7 @@ SENSOR_DESC_TEMPERATURE = SensorEntityDescription( native_unit_of_measurement=TEMP_CELSIUS, icon="mdi:thermometer", device_class=DEVICE_CLASS_TEMPERATURE, + state_class=STATE_CLASS_MEASUREMENT, ) SENSOR_DESC_HUMIDITY = SensorEntityDescription( @@ -52,6 +54,7 @@ SENSOR_DESC_HUMIDITY = SensorEntityDescription( native_unit_of_measurement=PERCENTAGE, icon="mdi:water-percent", device_class=DEVICE_CLASS_HUMIDITY, + state_class=STATE_CLASS_MEASUREMENT, ) SENSOR_DESC_POWER = SensorEntityDescription( @@ -60,6 +63,7 @@ SENSOR_DESC_POWER = SensorEntityDescription( native_unit_of_measurement=POWER_WATT, icon="mdi:power-plug", device_class=DEVICE_CLASS_POWER, + state_class=STATE_CLASS_MEASUREMENT, ) SENSOR_DESC_WINDOWHANDLE = SensorEntityDescription(