diff --git a/homeassistant/components/devolo_home_network/sensor.py b/homeassistant/components/devolo_home_network/sensor.py index b0f68ae280e..08d61cd6eff 100644 --- a/homeassistant/components/devolo_home_network/sensor.py +++ b/homeassistant/components/devolo_home_network/sensor.py @@ -8,13 +8,13 @@ from typing import Any from devolo_plc_api.device import Device from homeassistant.components.sensor import ( - STATE_CLASS_MEASUREMENT, SensorEntity, SensorEntityDescription, + SensorStateClass, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC from homeassistant.core import HomeAssistant +from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.update_coordinator import DataUpdateCoordinator @@ -44,7 +44,7 @@ class DevoloSensorEntityDescription( SENSOR_TYPES: dict[str, DevoloSensorEntityDescription] = { CONNECTED_PLC_DEVICES: DevoloSensorEntityDescription( key=CONNECTED_PLC_DEVICES, - entity_category=ENTITY_CATEGORY_DIAGNOSTIC, + entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, icon="mdi:lan", name="Connected PLC devices", @@ -57,12 +57,12 @@ SENSOR_TYPES: dict[str, DevoloSensorEntityDescription] = { entity_registry_enabled_default=True, icon="mdi:wifi", name="Connected Wifi clients", - state_class=STATE_CLASS_MEASUREMENT, + state_class=SensorStateClass.MEASUREMENT, value_func=lambda data: len(data["connected_stations"]), ), NEIGHBORING_WIFI_NETWORKS: DevoloSensorEntityDescription( key=NEIGHBORING_WIFI_NETWORKS, - entity_category=ENTITY_CATEGORY_DIAGNOSTIC, + entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, icon="mdi:wifi-marker", name="Neighboring Wifi networks",