mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Set goalzero total run time sensor device class to duration (#146897)
This commit is contained in:
parent
c335b5b37c
commit
25c408484c
@ -109,6 +109,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="timestamp",
|
||||
translation_key="timestamp",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -97,7 +97,7 @@ async def test_sensors(
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
||||
state = hass.states.get(f"sensor.{DEFAULT_NAME}_total_run_time")
|
||||
assert state.state == "1720984"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) is None
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.DURATION
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfTime.SECONDS
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
||||
state = hass.states.get(f"sensor.{DEFAULT_NAME}_wi_fi_ssid")
|
||||
|
Loading…
x
Reference in New Issue
Block a user