Use SensorDeviceClass.VOLUME in components (#79253)

This commit is contained in:
epenet 2022-09-29 09:38:06 +02:00 committed by GitHub
parent 0e764b57c2
commit fab3ee90b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 2 deletions

View file

@ -103,6 +103,7 @@ SENSOR_TYPES = (
name="Reservoir content",
icon="mdi:car-coolant-level",
native_unit_of_measurement=VOLUME_LITERS,
device_class=SensorDeviceClass.VOLUME,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coordinator: coordinator.data.reservoir_content,
@ -112,6 +113,7 @@ SENSOR_TYPES = (
name="Total saved",
icon="mdi:water-opacity",
native_unit_of_measurement=VOLUME_LITERS,
device_class=SensorDeviceClass.VOLUME,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coordinator: coordinator.data.total_saved,
@ -121,6 +123,7 @@ SENSOR_TYPES = (
name="Total replenished",
icon="mdi:water",
native_unit_of_measurement=VOLUME_LITERS,
device_class=SensorDeviceClass.VOLUME,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coordinator: coordinator.data.total_replenished,
@ -138,6 +141,7 @@ SENSOR_TYPES = (
name="Total use",
icon="mdi:chart-donut",
native_unit_of_measurement=VOLUME_LITERS,
device_class=SensorDeviceClass.VOLUME,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coordinator: coordinator.data.totver,
@ -147,6 +151,7 @@ SENSOR_TYPES = (
name="Max reservoir content",
icon="mdi:waves",
native_unit_of_measurement=VOLUME_LITERS,
device_class=SensorDeviceClass.VOLUME,
state_class=SensorStateClass.TOTAL,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda coordinator: coordinator.data.reservoir_content_max,