Use enum sensor device class in HomeKit Controller (#83109)
This commit is contained in:
@@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
import logging
|
||||
|
||||
from aiohomekit.model import Accessory, Transport
|
||||
from aiohomekit.model.characteristics import Characteristic, CharacteristicsTypes
|
||||
@@ -46,8 +45,6 @@ from .connection import HKDevice
|
||||
from .entity import CharacteristicEntity, HomeKitEntity
|
||||
from .utils import folded_name
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
class HomeKitSensorEntityDescription(SensorEntityDescription):
|
||||
@@ -299,16 +296,35 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||
CharacteristicsTypes.THREAD_NODE_CAPABILITIES: HomeKitSensorEntityDescription(
|
||||
key=CharacteristicsTypes.THREAD_NODE_CAPABILITIES,
|
||||
name="Thread Capabilities",
|
||||
device_class="homekit_controller__thread_node_capabilities",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
format=thread_node_capability_to_str,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=[
|
||||
"border_router_capable",
|
||||
"full",
|
||||
"minimal",
|
||||
"none",
|
||||
"router_eligible",
|
||||
"sleepy",
|
||||
],
|
||||
translation_key="thread_node_capabilities",
|
||||
),
|
||||
CharacteristicsTypes.THREAD_STATUS: HomeKitSensorEntityDescription(
|
||||
key=CharacteristicsTypes.THREAD_STATUS,
|
||||
name="Thread Status",
|
||||
device_class="homekit_controller__thread_status",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
format=thread_status_to_str,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=[
|
||||
"border_router",
|
||||
"child",
|
||||
"detached",
|
||||
"disabled",
|
||||
"joining",
|
||||
"leader",
|
||||
"router",
|
||||
],
|
||||
translation_key="thread_status",
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_NETATMO_NOISE: HomeKitSensorEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_NETATMO_NOISE,
|
||||
|
||||
Reference in New Issue
Block a user