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

@ -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