From 42c6920a91ac7d5343229a263397c74160d7cd14 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 5 Dec 2022 13:45:14 +0100 Subject: [PATCH] Migrate WLED translations (#83296) --- homeassistant/components/wled/const.py | 4 ---- homeassistant/components/wled/select.py | 4 ++-- homeassistant/components/wled/strings.json | 11 +++++++++++ homeassistant/components/wled/strings.select.json | 9 --------- homeassistant/components/wled/translations/en.json | 11 +++++++++++ 5 files changed, 24 insertions(+), 15 deletions(-) delete mode 100644 homeassistant/components/wled/strings.select.json diff --git a/homeassistant/components/wled/const.py b/homeassistant/components/wled/const.py index e323b5ab87b..40f831772bc 100644 --- a/homeassistant/components/wled/const.py +++ b/homeassistant/components/wled/const.py @@ -1,7 +1,6 @@ """Constants for the WLED integration.""" from datetime import timedelta import logging -from typing import Final # Integration domain DOMAIN = "wled" @@ -24,6 +23,3 @@ ATTR_SOFTWARE_VERSION = "sw_version" ATTR_SPEED = "speed" ATTR_TARGET_BRIGHTNESS = "target_brightness" ATTR_UDP_PORT = "udp_port" - -# Device classes -DEVICE_CLASS_WLED_LIVE_OVERRIDE: Final = "wled__live_override" diff --git a/homeassistant/components/wled/select.py b/homeassistant/components/wled/select.py index badde5515d4..8f6356e9e00 100644 --- a/homeassistant/components/wled/select.py +++ b/homeassistant/components/wled/select.py @@ -11,7 +11,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity import EntityCategory from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .const import DEVICE_CLASS_WLED_LIVE_OVERRIDE, DOMAIN +from .const import DOMAIN from .coordinator import WLEDDataUpdateCoordinator from .helpers import wled_exception_handler from .models import WLEDEntity @@ -48,10 +48,10 @@ async def async_setup_entry( class WLEDLiveOverrideSelect(WLEDEntity, SelectEntity): """Defined a WLED Live Override select.""" - _attr_device_class = DEVICE_CLASS_WLED_LIVE_OVERRIDE _attr_entity_category = EntityCategory.CONFIG _attr_icon = "mdi:theater" _attr_name = "Live override" + _attr_translation_key = "live_override" def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None: """Initialize WLED .""" diff --git a/homeassistant/components/wled/strings.json b/homeassistant/components/wled/strings.json index ac1eb4046dd..eed62ab0499 100644 --- a/homeassistant/components/wled/strings.json +++ b/homeassistant/components/wled/strings.json @@ -30,5 +30,16 @@ } } } + }, + "entity": { + "select": { + "live_override": { + "state": { + "0": "[%key:common::state::off%]", + "1": "[%key:common::state::on%]", + "2": "Until device restarts" + } + } + } } } diff --git a/homeassistant/components/wled/strings.select.json b/homeassistant/components/wled/strings.select.json deleted file mode 100644 index 9f678e380b4..00000000000 --- a/homeassistant/components/wled/strings.select.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "state": { - "wled__live_override": { - "0": "[%key:common::state::off%]", - "1": "[%key:common::state::on%]", - "2": "Until device restarts" - } - } -} diff --git a/homeassistant/components/wled/translations/en.json b/homeassistant/components/wled/translations/en.json index 4cc3e12bf2a..4ff8dbc566d 100644 --- a/homeassistant/components/wled/translations/en.json +++ b/homeassistant/components/wled/translations/en.json @@ -22,6 +22,17 @@ } } }, + "entity": { + "select": { + "live_override": { + "state": { + "0": "Off", + "1": "On", + "2": "Until device restarts" + } + } + } + }, "options": { "step": { "init": {