From da770df13f2cb4782798856be7a17f9cfa1d8f6f Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Fri, 6 Oct 2023 08:24:30 +0200 Subject: [PATCH] Change OpenWeatherMap unit_of_measurement from mm to mm/h (#101485) Change OWM unit_of_measurement --- homeassistant/components/openweathermap/sensor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/openweathermap/sensor.py b/homeassistant/components/openweathermap/sensor.py index 232664d5b6b..a1e0e9d2169 100644 --- a/homeassistant/components/openweathermap/sensor.py +++ b/homeassistant/components/openweathermap/sensor.py @@ -19,6 +19,7 @@ from homeassistant.const import ( UnitOfPressure, UnitOfSpeed, UnitOfTemperature, + UnitOfVolumetricFlux, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo @@ -123,15 +124,15 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key=ATTR_API_RAIN, name="Rain", - native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, - device_class=SensorDeviceClass.PRECIPITATION, + native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR, + device_class=SensorDeviceClass.PRECIPITATION_INTENSITY, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( key=ATTR_API_SNOW, name="Snow", - native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, - device_class=SensorDeviceClass.PRECIPITATION, + native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR, + device_class=SensorDeviceClass.PRECIPITATION_INTENSITY, state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription(