From 81ee5fb46baaba18cc36d78eed91c6310e3945cc Mon Sep 17 00:00:00 2001 From: Yuxin Wang Date: Fri, 7 Jun 2024 06:28:59 -0400 Subject: [PATCH] Refine sensor descriptions for APCUPSD (#114137) * Refine sensor descriptions for APCUPSD * Add device class for cumonbatt * Add UoM to STESTI and TIMELEFT * Remove device class for STESTI --- homeassistant/components/apcupsd/sensor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index 6ac33072856..8d2c1ee2af1 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -87,7 +87,9 @@ SENSORS: dict[str, SensorEntityDescription] = { "cumonbatt": SensorEntityDescription( key="cumonbatt", translation_key="total_time_on_battery", + native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.TOTAL_INCREASING, + device_class=SensorDeviceClass.DURATION, ), "date": SensorEntityDescription( key="date", @@ -340,12 +342,16 @@ SENSORS: dict[str, SensorEntityDescription] = { "timeleft": SensorEntityDescription( key="timeleft", translation_key="time_left", + native_unit_of_measurement=UnitOfTime.MINUTES, state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.DURATION, ), "tonbatt": SensorEntityDescription( key="tonbatt", translation_key="time_on_battery", + native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.TOTAL_INCREASING, + device_class=SensorDeviceClass.DURATION, ), "upsmode": SensorEntityDescription( key="upsmode",