Use device class enums in Verisure (#60685)
This commit is contained in:
parent
74f7f28f1c
commit
6c7c7acdef
2 changed files with 6 additions and 8 deletions
|
@ -2,8 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
DEVICE_CLASS_OPENING,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -40,7 +39,7 @@ class VerisureDoorWindowSensor(CoordinatorEntity, BinarySensorEntity):
|
|||
|
||||
coordinator: VerisureDataUpdateCoordinator
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_OPENING
|
||||
_attr_device_class = BinarySensorDeviceClass.OPENING
|
||||
|
||||
def __init__(
|
||||
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
|
||||
|
@ -87,7 +86,7 @@ class VerisureEthernetStatus(CoordinatorEntity, BinarySensorEntity):
|
|||
coordinator: VerisureDataUpdateCoordinator
|
||||
|
||||
_attr_name = "Verisure Ethernet status"
|
||||
_attr_device_class = DEVICE_CLASS_CONNECTIVITY
|
||||
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
|
||||
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||
|
||||
@property
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -51,7 +50,7 @@ class VerisureThermometer(CoordinatorEntity, SensorEntity):
|
|||
|
||||
coordinator: VerisureDataUpdateCoordinator
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_TEMPERATURE
|
||||
_attr_device_class = SensorDeviceClass.TEMPERATURE
|
||||
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
||||
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||
|
||||
|
@ -106,7 +105,7 @@ class VerisureHygrometer(CoordinatorEntity, SensorEntity):
|
|||
|
||||
coordinator: VerisureDataUpdateCoordinator
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_HUMIDITY
|
||||
_attr_device_class = SensorDeviceClass.HUMIDITY
|
||||
_attr_native_unit_of_measurement = PERCENTAGE
|
||||
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue