From 585dcf84f1babc7e46bdf9e1284dbd2eb41c72ae Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 25 Oct 2021 16:32:29 +0200 Subject: [PATCH] Add state_class/entity_category to Verisure (#58403) --- homeassistant/components/verisure/binary_sensor.py | 2 ++ homeassistant/components/verisure/sensor.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/homeassistant/components/verisure/binary_sensor.py b/homeassistant/components/verisure/binary_sensor.py index d2bdd05a9ac..a14efc7d4b1 100644 --- a/homeassistant/components/verisure/binary_sensor.py +++ b/homeassistant/components/verisure/binary_sensor.py @@ -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: diff --git a/homeassistant/components/verisure/sensor.py b/homeassistant/components/verisure/sensor.py index 2075dbe4a97..2016c4dbb83 100644 --- a/homeassistant/components/verisure/sensor.py +++ b/homeassistant/components/verisure/sensor.py @@ -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