Use new enums in tellduslive (#62426)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/62440/head
parent
3724a4fb2f
commit
9eb1a44c03
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue