Use uptime device_class for Uptime sensor (#169692)

This commit is contained in:
karwosts
2026-05-04 12:44:20 -04:00
committed by Paulus Schoutsen
parent 2d8f3691cf
commit 179d370c2a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ async def async_setup_entry(
class UptimeSensor(SensorEntity):
"""Representation of an uptime sensor."""
_attr_device_class = SensorDeviceClass.TIMESTAMP
_attr_device_class = SensorDeviceClass.UPTIME
_attr_has_entity_name = True
_attr_name = None
_attr_should_poll = False
@@ -2,7 +2,7 @@
# name: test_uptime_sensor
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'timestamp',
'device_class': 'uptime',
'friendly_name': 'Uptime',
}),
'context': <ANY>,
@@ -38,7 +38,7 @@
'object_id_base': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.TIMESTAMP: 'timestamp'>,
'original_device_class': <SensorDeviceClass.UPTIME: 'uptime'>,
'original_icon': None,
'original_name': None,
'platform': 'uptime',