Use new device class in homematic (#83303)

This commit is contained in:
epenet 2022-12-05 13:45:30 +01:00 committed by GitHub
parent 42c6920a91
commit b75eb71764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -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(