Use new DeviceClass and StateClass enums in enocean (#61387)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
980f22244c
commit
63efb809ee
1 changed files with 8 additions and 10 deletions
|
@ -5,17 +5,15 @@ import voluptuous as vol
|
|||
|
||||
from homeassistant.components.sensor import (
|
||||
PLATFORM_SCHEMA,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_ID,
|
||||
CONF_NAME,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_POWER,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PERCENTAGE,
|
||||
POWER_WATT,
|
||||
STATE_CLOSED,
|
||||
|
@ -44,8 +42,8 @@ SENSOR_DESC_TEMPERATURE = SensorEntityDescription(
|
|||
name="Temperature",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon="mdi:thermometer",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
)
|
||||
|
||||
SENSOR_DESC_HUMIDITY = SensorEntityDescription(
|
||||
|
@ -53,8 +51,8 @@ SENSOR_DESC_HUMIDITY = SensorEntityDescription(
|
|||
name="Humidity",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:water-percent",
|
||||
device_class=DEVICE_CLASS_HUMIDITY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
)
|
||||
|
||||
SENSOR_DESC_POWER = SensorEntityDescription(
|
||||
|
@ -62,8 +60,8 @@ SENSOR_DESC_POWER = SensorEntityDescription(
|
|||
name="Power",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
icon="mdi:power-plug",
|
||||
device_class=DEVICE_CLASS_POWER,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
)
|
||||
|
||||
SENSOR_DESC_WINDOWHANDLE = SensorEntityDescription(
|
||||
|
|
Loading…
Add table
Reference in a new issue