mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Move URL out of Switcher strings.json (#154240)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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%]"
|
||||
|
||||
Reference in New Issue
Block a user