Add missing state_class to xiaomi_aqara sensors (#73167)

Add missing state_class
This commit is contained in:
Maciej Bieniek 2022-06-07 19:57:29 +02:00 committed by GitHub
parent 981c34f88d
commit f10cae1052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@ from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
@ -30,36 +31,43 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
key="temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
"humidity": SensorEntityDescription(
key="humidity",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
),
"illumination": SensorEntityDescription(
key="illumination",
native_unit_of_measurement="lm",
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
"lux": SensorEntityDescription(
key="lux",
native_unit_of_measurement=LIGHT_LUX,
device_class=SensorDeviceClass.ILLUMINANCE,
state_class=SensorStateClass.MEASUREMENT,
),
"pressure": SensorEntityDescription(
key="pressure",
native_unit_of_measurement=PRESSURE_HPA,
device_class=SensorDeviceClass.PRESSURE,
state_class=SensorStateClass.MEASUREMENT,
),
"bed_activity": SensorEntityDescription(
key="bed_activity",
native_unit_of_measurement="μm",
device_class=None,
state_class=SensorStateClass.MEASUREMENT,
),
"load_power": SensorEntityDescription(
key="load_power",
native_unit_of_measurement=POWER_WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
"final_tilt_angle": SensorEntityDescription(
key="final_tilt_angle",
@ -69,6 +77,7 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
),
"Battery": SensorEntityDescription(
key="Battery",
state_class=SensorStateClass.MEASUREMENT,
),
}