From 38e255480aa240f2153e64c3f13d1e17e7155f16 Mon Sep 17 00:00:00 2001 From: Jasper Slits Date: Sun, 27 Oct 2024 12:39:50 +0000 Subject: [PATCH] Fix unit types for autotemp rooms --- custom_components/ithodaalderop/definitions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/ithodaalderop/definitions.py b/custom_components/ithodaalderop/definitions.py index 75670bc..9a9e9f8 100644 --- a/custom_components/ithodaalderop/definitions.py +++ b/custom_components/ithodaalderop/definitions.py @@ -17,6 +17,7 @@ from homeassistant.const import ( UnitOfTemperature, UnitOfTime, + UnitOfPower, UnitOfPressure, REVOLUTIONS_PER_MINUTE, PERCENTAGE @@ -146,8 +147,8 @@ class IthoBinarySensorEntityDescription(BinarySensorEntityDescription): json_field="Room X power % (%)", key=MQTT_STATETOPIC["autotemp"], translation_key="Room X power % (%)", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, + device_class=SensorDeviceClass.POWER_FACTOR, + native_unit_of_measurement="%", state_class=SensorStateClass.MEASUREMENT, ), IthoSensorEntityDescription( @@ -162,8 +163,8 @@ class IthoBinarySensorEntityDescription(BinarySensorEntityDescription): json_field="Room X power kW (kW)", key=MQTT_STATETOPIC["autotemp"], translation_key="Room X power kW", - device_class=SensorDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, + device_class=SensorDeviceClass.POWER, + native_unit_of_measurement=UnitOfPower.KILO_WATT, state_class=SensorStateClass.MEASUREMENT, ), IthoSensorEntityDescription(