Use new enums in tellduslive (#62426)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/62440/head
epenet 2021-12-20 21:04:24 +01:00 committed by GitHub
parent 3724a4fb2f
commit 9eb1a44c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -2,11 +2,12 @@
from __future__ import annotations
from homeassistant.components import sensor, tellduslive
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
LENGTH_MILLIMETERS,
LIGHT_LUX,
PERCENTAGE,
@ -38,13 +39,13 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
key=SENSOR_TYPE_TEMPERATURE,
name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
),
SENSOR_TYPE_HUMIDITY: SensorEntityDescription(
key=SENSOR_TYPE_HUMIDITY,
name="Humidity",
native_unit_of_measurement=PERCENTAGE,
device_class=DEVICE_CLASS_HUMIDITY,
device_class=SensorDeviceClass.HUMIDITY,
),
SENSOR_TYPE_RAINRATE: SensorEntityDescription(
key=SENSOR_TYPE_RAINRATE,
@ -86,13 +87,13 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
key=SENSOR_TYPE_LUMINANCE,
name="Luminance",
native_unit_of_measurement=LIGHT_LUX,
device_class=DEVICE_CLASS_ILLUMINANCE,
device_class=SensorDeviceClass.ILLUMINANCE,
),
SENSOR_TYPE_DEW_POINT: SensorEntityDescription(
key=SENSOR_TYPE_DEW_POINT,
name="Dew Point",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
),
SENSOR_TYPE_BAROMETRIC_PRESSURE: SensorEntityDescription(
key=SENSOR_TYPE_BAROMETRIC_PRESSURE,