1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Move url out of FreedomPro strings.json (#154786)

This commit is contained in:
Andrew Jackson
2025-10-18 19:46:58 +01:00
committed by GitHub
parent 378295e1cc
commit 553fcb5156
2 changed files with 13 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ from homeassistant.helpers import aiohttp_client
from .const import DOMAIN
STEP_USER_DATA_SCHEMA = vol.Schema({vol.Required(CONF_API_KEY): str})
API_KEY_URL = "https://freedompro.eu/"
class Hub:
@@ -53,7 +54,11 @@ class FreedomProConfigFlow(ConfigFlow, domain=DOMAIN):
"""Show the setup form to the user."""
if user_input is None:
return self.async_show_form(
step_id="user", data_schema=STEP_USER_DATA_SCHEMA
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
description_placeholders={
"api_key_url": API_KEY_URL,
},
)
errors = {}
@@ -68,7 +73,12 @@ class FreedomProConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_create_entry(title="Freedompro", data=user_input)
return self.async_show_form(
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
errors=errors,
description_placeholders={
"api_key_url": API_KEY_URL,
},
)

View File

@@ -5,7 +5,7 @@
"data": {
"api_key": "[%key:common::config_flow::data::api_key%]"
},
"description": "Please enter the API key obtained from https://home.freedompro.eu",
"description": "Please enter the API key obtained from {api_key_url}",
"title": "Freedompro API key"
}
},