From b75eb71764a3ede64af103b34aa8093688d4963c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 5 Dec 2022 13:45:30 +0100 Subject: [PATCH] Use new device class in homematic (#83303) --- homeassistant/components/homematic/sensor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/homematic/sensor.py b/homeassistant/components/homematic/sensor.py index 4c18afd0458..82d6aeb7cce 100644 --- a/homeassistant/components/homematic/sensor.py +++ b/homeassistant/components/homematic/sensor.py @@ -20,14 +20,14 @@ from homeassistant.const import ( ENERGY_KILO_WATT_HOUR, ENERGY_WATT_HOUR, FREQUENCY_HERTZ, - LENGTH_MILLIMETERS, LIGHT_LUX, PERCENTAGE, POWER_WATT, PRESSURE_HPA, - SPEED_KILOMETERS_PER_HOUR, TEMP_CELSIUS, VOLUME_CUBIC_METERS, + UnitOfPrecipitationDepth, + UnitOfSpeed, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -166,12 +166,13 @@ SENSOR_DESCRIPTIONS: dict[str, SensorEntityDescription] = { ), "RAIN_COUNTER": SensorEntityDescription( key="RAIN_COUNTER", - native_unit_of_measurement=LENGTH_MILLIMETERS, + native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, + device_class=SensorDeviceClass.PRECIPITATION, ), "WIND_SPEED": SensorEntityDescription( key="WIND_SPEED", - native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR, - device_class=SensorDeviceClass.SPEED, + native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR, + device_class=SensorDeviceClass.WIND_SPEED, icon="mdi:weather-windy", ), "WIND_DIRECTION": SensorEntityDescription(