Fix Goalzero time to empty sensor device class (#83389)
* Fix Goalzero time to empty sensor device class * Fix testspull/83482/head
parent
3a7efddb4b
commit
048553cd02
|
@ -91,7 +91,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="timeToEmptyFull",
|
key="timeToEmptyFull",
|
||||||
name="Time to empty/full",
|
name="Time to empty/full",
|
||||||
device_class=TIME_MINUTES,
|
device_class=SensorDeviceClass.DURATION,
|
||||||
native_unit_of_measurement=TIME_MINUTES,
|
native_unit_of_measurement=TIME_MINUTES,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
|
|
|
@ -77,7 +77,7 @@ async def test_sensors(
|
||||||
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
||||||
state = hass.states.get(f"sensor.{DEFAULT_NAME}_time_to_empty_full")
|
state = hass.states.get(f"sensor.{DEFAULT_NAME}_time_to_empty_full")
|
||||||
assert state.state == "-1"
|
assert state.state == "-1"
|
||||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == TIME_MINUTES
|
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.DURATION
|
||||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == TIME_MINUTES
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == TIME_MINUTES
|
||||||
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
assert state.attributes.get(ATTR_STATE_CLASS) is None
|
||||||
state = hass.states.get(f"sensor.{DEFAULT_NAME}_temperature")
|
state = hass.states.get(f"sensor.{DEFAULT_NAME}_temperature")
|
||||||
|
|
Loading…
Reference in New Issue