From 32dfc59d9e676014ee8d507d1fe25e04b23f8738 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 5 Dec 2022 13:44:59 +0100 Subject: [PATCH] Migrate HomeKit Controller translations (#83304) --- homeassistant/components/homekit_controller/const.py | 5 ----- homeassistant/components/homekit_controller/select.py | 3 +-- homeassistant/components/homekit_controller/strings.json | 9 +++++++++ .../components/homekit_controller/strings.select.json | 9 --------- .../components/homekit_controller/translations/en.json | 9 +++++++++ 5 files changed, 19 insertions(+), 16 deletions(-) delete mode 100644 homeassistant/components/homekit_controller/strings.select.json diff --git a/homeassistant/components/homekit_controller/const.py b/homeassistant/components/homekit_controller/const.py index 8b6a3e5fd30..3727fc272ad 100644 --- a/homeassistant/components/homekit_controller/const.py +++ b/homeassistant/components/homekit_controller/const.py @@ -1,6 +1,5 @@ """Constants for the homekit_controller component.""" import asyncio -from typing import Final from aiohomekit.exceptions import ( AccessoryDisconnectedError, @@ -97,10 +96,6 @@ CHARACTERISTIC_PLATFORMS = { CharacteristicsTypes.THREAD_NODE_CAPABILITIES: "sensor", } - -# Device classes -DEVICE_CLASS_ECOBEE_MODE: Final = "homekit_controller__ecobee_mode" - STARTUP_EXCEPTIONS = ( asyncio.TimeoutError, AccessoryNotFoundError, diff --git a/homeassistant/components/homekit_controller/select.py b/homeassistant/components/homekit_controller/select.py index ca5eaec4dc5..76067aea061 100644 --- a/homeassistant/components/homekit_controller/select.py +++ b/homeassistant/components/homekit_controller/select.py @@ -11,7 +11,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import KNOWN_DEVICES from .connection import HKDevice -from .const import DEVICE_CLASS_ECOBEE_MODE from .entity import CharacteristicEntity _ECOBEE_MODE_TO_TEXT = { @@ -26,7 +25,7 @@ class EcobeeModeSelect(CharacteristicEntity, SelectEntity): """Represents a ecobee mode select entity.""" _attr_options = ["home", "sleep", "away"] - _attr_device_class = DEVICE_CLASS_ECOBEE_MODE + _attr_translation_key = "ecobee_mode" @property def name(self) -> str: diff --git a/homeassistant/components/homekit_controller/strings.json b/homeassistant/components/homekit_controller/strings.json index 8b651309bdf..2291f66d88a 100644 --- a/homeassistant/components/homekit_controller/strings.json +++ b/homeassistant/components/homekit_controller/strings.json @@ -71,6 +71,15 @@ } }, "entity": { + "select": { + "ecobee_mode": { + "state": { + "away": "Away", + "home": "Home", + "sleep": "Sleep" + } + } + }, "sensor": { "thread_node_capabilities": { "state": { diff --git a/homeassistant/components/homekit_controller/strings.select.json b/homeassistant/components/homekit_controller/strings.select.json deleted file mode 100644 index af925b6681e..00000000000 --- a/homeassistant/components/homekit_controller/strings.select.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "state": { - "homekit_controller__ecobee_mode": { - "home": "Home", - "sleep": "Sleep", - "away": "Away" - } - } -} diff --git a/homeassistant/components/homekit_controller/translations/en.json b/homeassistant/components/homekit_controller/translations/en.json index 991177dbdf3..7f6e1848e9c 100644 --- a/homeassistant/components/homekit_controller/translations/en.json +++ b/homeassistant/components/homekit_controller/translations/en.json @@ -70,6 +70,15 @@ } }, "entity": { + "select": { + "ecobee_mode": { + "state": { + "away": "Away", + "home": "Home", + "sleep": "Sleep" + } + } + }, "sensor": { "thread_node_capabilities": { "state": {