Add state_class to EnOcean sensors (#57666)

pull/57728/head
David Le Brun 2021-10-14 23:15:16 +02:00 committed by GitHub
parent 2e5af5d8e2
commit 2601d71f5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import voluptuous as vol
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
SensorEntityDescription,
)
@ -44,6 +45,7 @@ SENSOR_DESC_TEMPERATURE = SensorEntityDescription(
native_unit_of_measurement=TEMP_CELSIUS,
icon="mdi:thermometer",
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
)
SENSOR_DESC_HUMIDITY = SensorEntityDescription(
@ -52,6 +54,7 @@ SENSOR_DESC_HUMIDITY = SensorEntityDescription(
native_unit_of_measurement=PERCENTAGE,
icon="mdi:water-percent",
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
)
SENSOR_DESC_POWER = SensorEntityDescription(
@ -60,6 +63,7 @@ SENSOR_DESC_POWER = SensorEntityDescription(
native_unit_of_measurement=POWER_WATT,
icon="mdi:power-plug",
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
)
SENSOR_DESC_WINDOWHANDLE = SensorEntityDescription(