mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Use SensorDeviceClass.VOLUME in HomeWizard (#79323)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
2688e5b2d4
commit
aa6f15b1e2
@ -130,7 +130,7 @@ SENSORS: Final[tuple[SensorEntityDescription, ...]] = (
|
|||||||
key="total_liter_m3",
|
key="total_liter_m3",
|
||||||
name="Total water usage",
|
name="Total water usage",
|
||||||
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||||
icon="mdi:gauge",
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -609,8 +609,8 @@ async def test_sensor_entity_total_liters(
|
|||||||
|
|
||||||
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.TOTAL_INCREASING
|
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.TOTAL_INCREASING
|
||||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == VOLUME_CUBIC_METERS
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == VOLUME_CUBIC_METERS
|
||||||
assert ATTR_DEVICE_CLASS not in state.attributes
|
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.VOLUME
|
||||||
assert state.attributes.get(ATTR_ICON) == "mdi:gauge"
|
assert state.attributes.get(ATTR_ICON) is None
|
||||||
|
|
||||||
|
|
||||||
async def test_sensor_entity_disabled_when_null(
|
async def test_sensor_entity_disabled_when_null(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user