From f2bd4131eb8728782fb0f160fd6d764aa42dc2dc Mon Sep 17 00:00:00 2001 From: Tobias Perschon Date: Tue, 26 Apr 2022 19:27:39 +0200 Subject: [PATCH] Add missing state_class and device_cass attributes to daikin sensors (#70317) --- homeassistant/components/daikin/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/daikin/sensor.py b/homeassistant/components/daikin/sensor.py index 39a6f4aa853..1843bdac25f 100644 --- a/homeassistant/components/daikin/sensor.py +++ b/homeassistant/components/daikin/sensor.py @@ -87,6 +87,7 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = ( key=ATTR_TOTAL_POWER, name="Estimated Power Consumption", device_class=SensorDeviceClass.POWER, + state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=POWER_KILO_WATT, value_func=lambda device: round(device.current_total_power_consumption, 2), ), @@ -110,6 +111,8 @@ SENSOR_TYPES: tuple[DaikinSensorEntityDescription, ...] = ( key=ATTR_COMPRESSOR_FREQUENCY, name="Compressor Frequency", icon="mdi:fan", + device_class=SensorDeviceClass.FREQUENCY, + state_class=SensorStateClass.MEASUREMENT, native_unit_of_measurement=FREQUENCY_HERTZ, value_func=lambda device: device.compressor_frequency, ),