From ae3d32073c7f446f474f0feaceaa89b8ada77a5e Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Tue, 14 Oct 2025 15:47:22 +0300 Subject: [PATCH] Move URL out of Switcher strings.json (#154240) --- homeassistant/components/switcher_kis/config_flow.py | 8 ++++++-- homeassistant/components/switcher_kis/const.py | 4 ++++ homeassistant/components/switcher_kis/strings.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switcher_kis/config_flow.py b/homeassistant/components/switcher_kis/config_flow.py index ee015cb1a25..d0803b117e2 100644 --- a/homeassistant/components/switcher_kis/config_flow.py +++ b/homeassistant/components/switcher_kis/config_flow.py @@ -13,7 +13,7 @@ import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_TOKEN, CONF_USERNAME -from .const import DOMAIN +from .const import DOMAIN, PREREQUISITES_URL from .utils import async_discover_devices _LOGGER = logging.getLogger(__name__) @@ -77,7 +77,10 @@ class SwitcherFlowHandler(ConfigFlow, domain=DOMAIN): errors["base"] = "invalid_auth" return self.async_show_form( - step_id="credentials", data_schema=CONFIG_SCHEMA, errors=errors + step_id="credentials", + data_schema=CONFIG_SCHEMA, + errors=errors, + description_placeholders={"prerequisites_url": PREREQUISITES_URL}, ) async def async_step_reauth( @@ -106,6 +109,7 @@ class SwitcherFlowHandler(ConfigFlow, domain=DOMAIN): step_id="reauth_confirm", data_schema=CONFIG_SCHEMA, errors=errors, + description_placeholders={"prerequisites_url": PREREQUISITES_URL}, ) async def _create_entry(self) -> ConfigFlowResult: diff --git a/homeassistant/components/switcher_kis/const.py b/homeassistant/components/switcher_kis/const.py index 9edc69e4946..6abf1c44312 100644 --- a/homeassistant/components/switcher_kis/const.py +++ b/homeassistant/components/switcher_kis/const.py @@ -14,3 +14,7 @@ SERVICE_TURN_ON_WITH_TIMER_NAME = "turn_on_with_timer" # Defines the maximum interval device must send an update before it marked unavailable MAX_UPDATE_INTERVAL_SEC = 30 + +PREREQUISITES_URL = ( + "https://www.home-assistant.io/integrations/switcher_kis/#prerequisites" +) diff --git a/homeassistant/components/switcher_kis/strings.json b/homeassistant/components/switcher_kis/strings.json index 5eece295aa8..33bbdc345d3 100644 --- a/homeassistant/components/switcher_kis/strings.json +++ b/homeassistant/components/switcher_kis/strings.json @@ -5,7 +5,7 @@ "description": "[%key:common::config_flow::description::confirm_setup%]" }, "credentials": { - "description": "Found a Switcher device that requires a token\nEnter your username and token\nFor more information see https://www.home-assistant.io/integrations/switcher_kis/#prerequisites", + "description": "Found a Switcher device that requires a token\nEnter your username and token\nFor more information see {prerequisites_url}", "data": { "username": "[%key:common::config_flow::data::username%]", "token": "[%key:common::config_flow::data::access_token%]"