From fb56c5875ac223ca55a52a08f0e7f6f96be3c7c8 Mon Sep 17 00:00:00 2001 From: Tatham Oddie Date: Fri, 20 Sep 2024 20:04:24 +1000 Subject: [PATCH] Add device class for UPNP uptime sensor (#126306) Allows for easier conversion of time periods within HA natively --- homeassistant/components/upnp/sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index d6da50c877d..aae2f8308c1 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -89,6 +89,7 @@ SENSOR_DESCRIPTIONS: tuple[UpnpSensorEntityDescription, ...] = ( UpnpSensorEntityDescription( key=ROUTER_UPTIME, translation_key="uptime", + device_class=SensorDeviceClass.DURATION, native_unit_of_measurement=UnitOfTime.SECONDS, entity_registry_enabled_default=False, entity_category=EntityCategory.DIAGNOSTIC,