From 943c1d1214106490d6e6da953db071a29713d7a8 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Wed, 13 Dec 2023 21:07:07 +0000 Subject: [PATCH] Add first translations --- custom_components/nest_protect/select.py | 4 ++-- custom_components/nest_protect/strings.json | 12 ++++++++++++ custom_components/nest_protect/translations/en.json | 12 ++++++++++++ .../nest_protect/translations/select.en.json | 9 --------- 4 files changed, 26 insertions(+), 11 deletions(-) delete mode 100644 custom_components/nest_protect/translations/select.en.json diff --git a/custom_components/nest_protect/select.py b/custom_components/nest_protect/select.py index 96f6521..102be24 100644 --- a/custom_components/nest_protect/select.py +++ b/custom_components/nest_protect/select.py @@ -8,7 +8,7 @@ from . import HomeAssistantNestProtectData from .const import DOMAIN, LOGGER -from .entity import NestDescriptiveEntity, NestProtectDeviceClass +from .entity import NestDescriptiveEntity @dataclass @@ -24,11 +24,11 @@ class NestProtectSelectDescription(SelectEntityDescription): SENSOR_DESCRIPTIONS: list[SelectEntityDescription] = [ NestProtectSelectDescription( key="night_light_brightness", + translation_key="night_light_brightness", name="Brightness", icon="mdi:lightbulb-on", options=[*PRESET_TO_BRIGHTNESS], entity_category=EntityCategory.CONFIG, - device_class=NestProtectDeviceClass.NIGHT_LIGHT_BRIGHTNESS, ), ] diff --git a/custom_components/nest_protect/strings.json b/custom_components/nest_protect/strings.json index 3b245ff..66bd477 100644 --- a/custom_components/nest_protect/strings.json +++ b/custom_components/nest_protect/strings.json @@ -22,5 +22,17 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_account%]" } + }, + "entity": { + "select": { + "night_light_brightness": { + "name": "Night Light Brightness", + "state": { + "low": "Low", + "medium": "Medium", + "high": "High" + } + } + } } } \ No newline at end of file diff --git a/custom_components/nest_protect/translations/en.json b/custom_components/nest_protect/translations/en.json index 8f2fc28..1989cc4 100644 --- a/custom_components/nest_protect/translations/en.json +++ b/custom_components/nest_protect/translations/en.json @@ -22,5 +22,17 @@ } } } + }, + "entity": { + "select": { + "night_light_brightness": { + "name": "Night Light Brightness", + "state": { + "low": "Low", + "medium": "Medium", + "high": "High" + } + } + } } } \ No newline at end of file diff --git a/custom_components/nest_protect/translations/select.en.json b/custom_components/nest_protect/translations/select.en.json deleted file mode 100644 index 1c67f01..0000000 --- a/custom_components/nest_protect/translations/select.en.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "state": { - "nest_protect__night_light_brightness": { - "low": "Low", - "medium": "Medium", - "high": "High" - } - } -} \ No newline at end of file