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 __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components import sensor, tellduslive
|
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 (
|
from homeassistant.const import (
|
||||||
DEVICE_CLASS_HUMIDITY,
|
|
||||||
DEVICE_CLASS_ILLUMINANCE,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
LENGTH_MILLIMETERS,
|
LENGTH_MILLIMETERS,
|
||||||
LIGHT_LUX,
|
LIGHT_LUX,
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
|
@ -38,13 +39,13 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
|
||||||
key=SENSOR_TYPE_TEMPERATURE,
|
key=SENSOR_TYPE_TEMPERATURE,
|
||||||
name="Temperature",
|
name="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_HUMIDITY: SensorEntityDescription(
|
SENSOR_TYPE_HUMIDITY: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_HUMIDITY,
|
key=SENSOR_TYPE_HUMIDITY,
|
||||||
name="Humidity",
|
name="Humidity",
|
||||||
native_unit_of_measurement=PERCENTAGE,
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
device_class=DEVICE_CLASS_HUMIDITY,
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_RAINRATE: SensorEntityDescription(
|
SENSOR_TYPE_RAINRATE: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_RAINRATE,
|
key=SENSOR_TYPE_RAINRATE,
|
||||||
|
@ -86,13 +87,13 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
|
||||||
key=SENSOR_TYPE_LUMINANCE,
|
key=SENSOR_TYPE_LUMINANCE,
|
||||||
name="Luminance",
|
name="Luminance",
|
||||||
native_unit_of_measurement=LIGHT_LUX,
|
native_unit_of_measurement=LIGHT_LUX,
|
||||||
device_class=DEVICE_CLASS_ILLUMINANCE,
|
device_class=SensorDeviceClass.ILLUMINANCE,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_DEW_POINT: SensorEntityDescription(
|
SENSOR_TYPE_DEW_POINT: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_DEW_POINT,
|
key=SENSOR_TYPE_DEW_POINT,
|
||||||
name="Dew Point",
|
name="Dew Point",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
SENSOR_TYPE_BAROMETRIC_PRESSURE: SensorEntityDescription(
|
SENSOR_TYPE_BAROMETRIC_PRESSURE: SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_BAROMETRIC_PRESSURE,
|
key=SENSOR_TYPE_BAROMETRIC_PRESSURE,
|
||||||
|
|
Loading…
Reference in New Issue