Use new enums in verisure (#62433)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-20 20:56:33 +01:00 committed by GitHub
parent 6a5192b170
commit 2f8e44641b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -6,9 +6,8 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo, Entity
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
@ -87,7 +86,7 @@ class VerisureEthernetStatus(CoordinatorEntity, BinarySensorEntity):
_attr_name = "Verisure Ethernet status"
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
_attr_entity_category = EntityCategory.DIAGNOSTIC
@property
def unique_id(self) -> str:

View File

@ -2,9 +2,9 @@
from __future__ import annotations
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
@ -52,7 +52,7 @@ class VerisureThermometer(CoordinatorEntity, SensorEntity):
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
_attr_state_class = STATE_CLASS_MEASUREMENT
_attr_state_class = SensorStateClass.MEASUREMENT
def __init__(
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
@ -107,7 +107,7 @@ class VerisureHygrometer(CoordinatorEntity, SensorEntity):
_attr_device_class = SensorDeviceClass.HUMIDITY
_attr_native_unit_of_measurement = PERCENTAGE
_attr_state_class = STATE_CLASS_MEASUREMENT
_attr_state_class = SensorStateClass.MEASUREMENT
def __init__(
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str