Use device class enum in Open Garage (#60702)
This commit is contained in:
parent
739ce9bc75
commit
38c2c879c9
1 changed files with 4 additions and 6 deletions
|
@ -5,13 +5,11 @@ import logging
|
|||
|
||||
from homeassistant.components.sensor import (
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_SIGNAL_STRENGTH,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
LENGTH_CENTIMETERS,
|
||||
PERCENTAGE,
|
||||
|
@ -33,7 +31,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
),
|
||||
SensorEntityDescription(
|
||||
key="rssi",
|
||||
device_class=DEVICE_CLASS_SIGNAL_STRENGTH,
|
||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS,
|
||||
|
@ -41,13 +39,13 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
),
|
||||
SensorEntityDescription(
|
||||
key="temp",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="humid",
|
||||
device_class=DEVICE_CLASS_HUMIDITY,
|
||||
device_class=SensorDeviceClass.HUMIDITY,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue