Migrate HomeKit Controller translations ()

This commit is contained in:
Franck Nijhof 2022-12-05 13:44:59 +01:00 committed by GitHub
parent 226a880645
commit 32dfc59d9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 16 deletions
homeassistant/components/homekit_controller

View file

@ -1,6 +1,5 @@
"""Constants for the homekit_controller component.""" """Constants for the homekit_controller component."""
import asyncio import asyncio
from typing import Final
from aiohomekit.exceptions import ( from aiohomekit.exceptions import (
AccessoryDisconnectedError, AccessoryDisconnectedError,
@ -97,10 +96,6 @@ CHARACTERISTIC_PLATFORMS = {
CharacteristicsTypes.THREAD_NODE_CAPABILITIES: "sensor", CharacteristicsTypes.THREAD_NODE_CAPABILITIES: "sensor",
} }
# Device classes
DEVICE_CLASS_ECOBEE_MODE: Final = "homekit_controller__ecobee_mode"
STARTUP_EXCEPTIONS = ( STARTUP_EXCEPTIONS = (
asyncio.TimeoutError, asyncio.TimeoutError,
AccessoryNotFoundError, AccessoryNotFoundError,

View file

@ -11,7 +11,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import KNOWN_DEVICES from . import KNOWN_DEVICES
from .connection import HKDevice from .connection import HKDevice
from .const import DEVICE_CLASS_ECOBEE_MODE
from .entity import CharacteristicEntity from .entity import CharacteristicEntity
_ECOBEE_MODE_TO_TEXT = { _ECOBEE_MODE_TO_TEXT = {
@ -26,7 +25,7 @@ class EcobeeModeSelect(CharacteristicEntity, SelectEntity):
"""Represents a ecobee mode select entity.""" """Represents a ecobee mode select entity."""
_attr_options = ["home", "sleep", "away"] _attr_options = ["home", "sleep", "away"]
_attr_device_class = DEVICE_CLASS_ECOBEE_MODE _attr_translation_key = "ecobee_mode"
@property @property
def name(self) -> str: def name(self) -> str:

View file

@ -71,6 +71,15 @@
} }
}, },
"entity": { "entity": {
"select": {
"ecobee_mode": {
"state": {
"away": "Away",
"home": "Home",
"sleep": "Sleep"
}
}
},
"sensor": { "sensor": {
"thread_node_capabilities": { "thread_node_capabilities": {
"state": { "state": {

View file

@ -1,9 +0,0 @@
{
"state": {
"homekit_controller__ecobee_mode": {
"home": "Home",
"sleep": "Sleep",
"away": "Away"
}
}
}

View file

@ -70,6 +70,15 @@
} }
}, },
"entity": { "entity": {
"select": {
"ecobee_mode": {
"state": {
"away": "Away",
"home": "Home",
"sleep": "Sleep"
}
}
},
"sensor": { "sensor": {
"thread_node_capabilities": { "thread_node_capabilities": {
"state": { "state": {