Add state_class/entity_category to Verisure (#58403)

This commit is contained in:
Franck Nijhof 2021-10-25 16:32:29 +02:00 committed by GitHub
parent fe15736418
commit 585dcf84f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ 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_platform import AddEntitiesCallback
@ -87,6 +88,7 @@ class VerisureEthernetStatus(CoordinatorEntity, BinarySensorEntity):
_attr_name = "Verisure Ethernet status"
_attr_device_class = DEVICE_CLASS_CONNECTIVITY
_attr_entity_category = ENTITY_CATEGORY_DIAGNOSTIC
@property
def unique_id(self) -> str:

View File

@ -4,6 +4,7 @@ from __future__ import annotations
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.config_entries import ConfigEntry
@ -52,6 +53,7 @@ class VerisureThermometer(CoordinatorEntity, SensorEntity):
_attr_device_class = DEVICE_CLASS_TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
_attr_state_class = STATE_CLASS_MEASUREMENT
def __init__(
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str
@ -106,6 +108,7 @@ class VerisureHygrometer(CoordinatorEntity, SensorEntity):
_attr_device_class = DEVICE_CLASS_HUMIDITY
_attr_native_unit_of_measurement = PERCENTAGE
_attr_state_class = STATE_CLASS_MEASUREMENT
def __init__(
self, coordinator: VerisureDataUpdateCoordinator, serial_number: str