Skip to content

Commit ae3d320

Browse files
authored
Move URL out of Switcher strings.json (home-assistant#154240)
1 parent 38d0299 commit ae3d320

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

homeassistant/components/switcher_kis/config_flow.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
1414
from homeassistant.const import CONF_TOKEN, CONF_USERNAME
1515

16-
from .const import DOMAIN
16+
from .const import DOMAIN, PREREQUISITES_URL
1717
from .utils import async_discover_devices
1818

1919
_LOGGER = logging.getLogger(__name__)
@@ -77,7 +77,10 @@ async def async_step_credentials(
7777
errors["base"] = "invalid_auth"
7878

7979
return self.async_show_form(
80-
step_id="credentials", data_schema=CONFIG_SCHEMA, errors=errors
80+
step_id="credentials",
81+
data_schema=CONFIG_SCHEMA,
82+
errors=errors,
83+
description_placeholders={"prerequisites_url": PREREQUISITES_URL},
8184
)
8285

8386
async def async_step_reauth(
@@ -106,6 +109,7 @@ async def async_step_reauth_confirm(
106109
step_id="reauth_confirm",
107110
data_schema=CONFIG_SCHEMA,
108111
errors=errors,
112+
description_placeholders={"prerequisites_url": PREREQUISITES_URL},
109113
)
110114

111115
async def _create_entry(self) -> ConfigFlowResult:

homeassistant/components/switcher_kis/const.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414

1515
# Defines the maximum interval device must send an update before it marked unavailable
1616
MAX_UPDATE_INTERVAL_SEC = 30
17+
18+
PREREQUISITES_URL = (
19+
"https://www.home-assistant.io/integrations/switcher_kis/#prerequisites"
20+
)

homeassistant/components/switcher_kis/strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "[%key:common::config_flow::description::confirm_setup%]"
66
},
77
"credentials": {
8-
"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",
8+
"description": "Found a Switcher device that requires a token\nEnter your username and token\nFor more information see {prerequisites_url}",
99
"data": {
1010
"username": "[%key:common::config_flow::data::username%]",
1111
"token": "[%key:common::config_flow::data::access_token%]"

0 commit comments

Comments
 (0)