From b6a06f49b776da87be70c9ff9d336057dc6741d9 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 15 Mar 2024 19:12:04 +0100 Subject: [PATCH] Use Volume Flow Rate device class in DROP connect (#113528) --- homeassistant/components/drop_connect/sensor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/drop_connect/sensor.py b/homeassistant/components/drop_connect/sensor.py index 249922a4b3c..0806737254e 100644 --- a/homeassistant/components/drop_connect/sensor.py +++ b/homeassistant/components/drop_connect/sensor.py @@ -20,6 +20,7 @@ from homeassistant.const import ( UnitOfPressure, UnitOfTemperature, UnitOfVolume, + UnitOfVolumeFlowRate, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -70,7 +71,8 @@ SENSORS: list[DROPSensorEntityDescription] = [ DROPSensorEntityDescription( key=CURRENT_FLOW_RATE, translation_key=CURRENT_FLOW_RATE, - native_unit_of_measurement="gpm", + device_class=SensorDeviceClass.VOLUME_FLOW_RATE, + native_unit_of_measurement=UnitOfVolumeFlowRate.GALLONS_PER_MINUTE, suggested_display_precision=1, value_fn=lambda device: device.drop_api.current_flow_rate(), state_class=SensorStateClass.MEASUREMENT, @@ -78,7 +80,8 @@ SENSORS: list[DROPSensorEntityDescription] = [ DROPSensorEntityDescription( key=PEAK_FLOW_RATE, translation_key=PEAK_FLOW_RATE, - native_unit_of_measurement="gpm", + device_class=SensorDeviceClass.VOLUME_FLOW_RATE, + native_unit_of_measurement=UnitOfVolumeFlowRate.GALLONS_PER_MINUTE, suggested_display_precision=1, value_fn=lambda device: device.drop_api.peak_flow_rate(), state_class=SensorStateClass.MEASUREMENT,