Use new SensorDeviceClass enum in canary (#61330)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/61338/head
parent
bdbecc6c05
commit
dfc85fe372
|
@ -5,13 +5,9 @@ from typing import Final
|
|||
|
||||
from canary.api import Device, Location, SensorType
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_SIGNAL_STRENGTH,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
PERCENTAGE,
|
||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||
TEMP_CELSIUS,
|
||||
|
@ -38,17 +34,17 @@ CANARY_FLEX: Final = "Canary Flex"
|
|||
# Sensor types are defined like so:
|
||||
# sensor type name, unit_of_measurement, icon, device class, products supported
|
||||
SENSOR_TYPES: Final[list[SensorTypeItem]] = [
|
||||
("temperature", TEMP_CELSIUS, None, DEVICE_CLASS_TEMPERATURE, [CANARY_PRO]),
|
||||
("humidity", PERCENTAGE, None, DEVICE_CLASS_HUMIDITY, [CANARY_PRO]),
|
||||
("temperature", TEMP_CELSIUS, None, SensorDeviceClass.TEMPERATURE, [CANARY_PRO]),
|
||||
("humidity", PERCENTAGE, None, SensorDeviceClass.HUMIDITY, [CANARY_PRO]),
|
||||
("air_quality", None, "mdi:weather-windy", None, [CANARY_PRO]),
|
||||
(
|
||||
"wifi",
|
||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||
None,
|
||||
DEVICE_CLASS_SIGNAL_STRENGTH,
|
||||
SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
[CANARY_FLEX],
|
||||
),
|
||||
("battery", PERCENTAGE, None, DEVICE_CLASS_BATTERY, [CANARY_FLEX]),
|
||||
("battery", PERCENTAGE, None, SensorDeviceClass.BATTERY, [CANARY_FLEX]),
|
||||
]
|
||||
|
||||
STATE_AIR_QUALITY_NORMAL: Final = "normal"
|
||||
|
|
Loading…
Reference in New Issue