Use new enums in devolo_home_network (#61348)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
c5815ef936
commit
50940844b8
1 changed files with 5 additions and 5 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue