From 9457c7e24ca33d7ed2a9021ecacae3a7ae43d29e Mon Sep 17 00:00:00 2001 From: David Mulcahey Date: Wed, 28 Apr 2021 10:09:03 -0400 Subject: [PATCH 1/3] Move custom ZHA config translations to the backend --- homeassistant/components/zha/strings.json | 13 +++++++++++++ homeassistant/components/zha/translations/en.json | 13 +++++++++++++ script/hassfest/translations.py | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/homeassistant/components/zha/strings.json b/homeassistant/components/zha/strings.json index 550fad3c2c5886..2c2a93aa4d68f3 100644 --- a/homeassistant/components/zha/strings.json +++ b/homeassistant/components/zha/strings.json @@ -29,6 +29,19 @@ "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } }, + "config_panel": { + "zha_options": { + "title": "Global Options", + "enable_identify_on_join": "Enable identify effect when devices join the network", + "default_light_transition": "Default light transition time (seconds)" + }, + "zha_alarm_options": { + "title": "Alarm Control Panel Options", + "alarm_master_code": "Master code for the alarm control panel(s)", + "alarm_failed_tries": "The number of consecutive failed code entries to trigger an alarm", + "alarm_arm_requires_code": "Code required for arming actions" + } + }, "device_automation": { "action_type": { "squawk": "Squawk", "warn": "Warn" }, "trigger_type": { diff --git a/homeassistant/components/zha/translations/en.json b/homeassistant/components/zha/translations/en.json index d3ed2ddfce4a10..2a6aa34d886ceb 100644 --- a/homeassistant/components/zha/translations/en.json +++ b/homeassistant/components/zha/translations/en.json @@ -33,6 +33,19 @@ } } }, + "config_panel": { + "zha_alarm_options": { + "alarm_arm_requires_code": "Code required for arming actions", + "alarm_failed_tries": "The number of consecutive failed code entries to trigger an alarm", + "alarm_master_code": "Master code for the alarm control panel(s)", + "title": "Alarm Control Panel Options" + }, + "zha_options": { + "default_light_transition": "Default light transition time (seconds)", + "enable_identify_on_join": "Enable identify effect when devices join the network", + "title": "Global Options" + } + }, "device_automation": { "action_type": { "squawk": "Squawk", diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index b7a6341d25c087..cbb1f26695a343 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -142,6 +142,10 @@ def gen_strings_schema(config: Config, integration: Integration): vol.Optional("system_health"): { vol.Optional("info"): {str: cv.string_with_no_html} }, + vol.Optional("config_panel"): cv.schema_with_slug_keys( + cv.schema_with_slug_keys(str, slug_validator=lowercase_validator), + slug_validator=vol.Any("_", cv.slug), + ), } ) From 4e40ff4e422a93e67e4ed27ab025db2e8eb50d7e Mon Sep 17 00:00:00 2001 From: David Mulcahey Date: Wed, 28 Apr 2021 10:19:06 -0400 Subject: [PATCH 2/3] change schema --- script/hassfest/translations.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index cbb1f26695a343..cffbdeeee3920e 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -142,10 +142,9 @@ def gen_strings_schema(config: Config, integration: Integration): vol.Optional("system_health"): { vol.Optional("info"): {str: cv.string_with_no_html} }, - vol.Optional("config_panel"): cv.schema_with_slug_keys( - cv.schema_with_slug_keys(str, slug_validator=lowercase_validator), - slug_validator=vol.Any("_", cv.slug), - ), + vol.Optional("config_panel"): { + vol.Optional("info"): {str: cv.string_with_no_html} + }, } ) From cd1f7e829ba115e88179ddd177ca3f4fff3c1a2b Mon Sep 17 00:00:00 2001 From: David Mulcahey Date: Wed, 28 Apr 2021 10:24:46 -0400 Subject: [PATCH 3/3] update schema --- script/hassfest/translations.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/hassfest/translations.py b/script/hassfest/translations.py index cffbdeeee3920e..4143d61ca5df87 100644 --- a/script/hassfest/translations.py +++ b/script/hassfest/translations.py @@ -142,9 +142,12 @@ def gen_strings_schema(config: Config, integration: Integration): vol.Optional("system_health"): { vol.Optional("info"): {str: cv.string_with_no_html} }, - vol.Optional("config_panel"): { - vol.Optional("info"): {str: cv.string_with_no_html} - }, + vol.Optional("config_panel"): cv.schema_with_slug_keys( + cv.schema_with_slug_keys( + cv.string_with_no_html, slug_validator=lowercase_validator + ), + slug_validator=vol.Any("_", cv.slug), + ), } )