Add state_class/entity_category to Verisure (#58403)
parent
fe15736418
commit
585dcf84f1
|
@ -7,6 +7,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -87,6 +88,7 @@ class VerisureEthernetStatus(CoordinatorEntity, BinarySensorEntity):
|
||||||
|
|
||||||
_attr_name = "Verisure Ethernet status"
|
_attr_name = "Verisure Ethernet status"
|
||||||
_attr_device_class = DEVICE_CLASS_CONNECTIVITY
|
_attr_device_class = DEVICE_CLASS_CONNECTIVITY
|
||||||
|
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
|
|
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
@ -52,6 +53,7 @@ class VerisureThermometer(CoordinatorEntity, SensorEntity):
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_TEMPERATURE
|
_attr_device_class = DEVICE_CLASS_TEMPERATURE
|
||||||
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
_attr_native_unit_of_measurement = TEMP_CELSIUS
|
||||||
|
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
|
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
|
||||||
|
@ -106,6 +108,7 @@ class VerisureHygrometer(CoordinatorEntity, SensorEntity):
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_HUMIDITY
|
_attr_device_class = DEVICE_CLASS_HUMIDITY
|
||||||
_attr_native_unit_of_measurement = PERCENTAGE
|
_attr_native_unit_of_measurement = PERCENTAGE
|
||||||
|
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
|
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
|
||||||
|
|
Loading…
Reference in New Issue