Use new SensorDeviceClass in mitemp-bt (#61925)

pull/61927/head
epenet 2021-12-15 20:14:50 +01:00 committed by GitHub
parent d95ce8a026
commit 6102e0aae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -11,6 +11,7 @@ import voluptuous as vol
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
) )
@ -20,9 +21,6 @@ from homeassistant.const import (
CONF_MONITORED_CONDITIONS, CONF_MONITORED_CONDITIONS,
CONF_NAME, CONF_NAME,
CONF_TIMEOUT, CONF_TIMEOUT,
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
PERCENTAGE, PERCENTAGE,
TEMP_CELSIUS, TEMP_CELSIUS,
) )
@ -55,19 +53,19 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription( SensorEntityDescription(
key="temperature", key="temperature",
name="Temperature", name="Temperature",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
), ),
SensorEntityDescription( SensorEntityDescription(
key="humidity", key="humidity",
name="Humidity", name="Humidity",
device_class=DEVICE_CLASS_HUMIDITY, device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
), ),
SensorEntityDescription( SensorEntityDescription(
key="battery", key="battery",
name="Battery", name="Battery",
device_class=DEVICE_CLASS_BATTERY, device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE, native_unit_of_measurement=PERCENTAGE,
), ),
) )