From 5cdf8e5961e1bb7a24f580ecb6d42eca378d88d3 Mon Sep 17 00:00:00 2001 From: Clawd Date: Thu, 29 Jan 2026 09:18:37 +0000 Subject: [PATCH] fix: use translation placeholders for docs URL in config flow Hassfest validation fails when URLs are hardcoded in translation strings. Use description_placeholders to inject the documentation URL dynamically. - Update en.json and de.json to use {docs_url} placeholder - Pass description_placeholders in config_flow.py async_show_form() Fixes #390 --- custom_components/weenect/config_flow.py | 1 + custom_components/weenect/translations/de.json | 2 +- custom_components/weenect/translations/en.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/weenect/config_flow.py b/custom_components/weenect/config_flow.py index a202e48..2a77602 100644 --- a/custom_components/weenect/config_flow.py +++ b/custom_components/weenect/config_flow.py @@ -58,6 +58,7 @@ async def _show_config_form(self, user_input) -> FlowResult: step_id="user", data_schema=vol.Schema({vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str}), errors=self._errors, + description_placeholders={"docs_url": "https://github.com/eifinger/hass-weenect"}, ) async def _test_credentials(self, username, password) -> bool: diff --git a/custom_components/weenect/translations/de.json b/custom_components/weenect/translations/de.json index d5b7dbf..876c424 100644 --- a/custom_components/weenect/translations/de.json +++ b/custom_components/weenect/translations/de.json @@ -2,7 +2,7 @@ "config": { "step": { "user": { - "description": "Wenn du Hilfe benötigst findest du sie vielleicht hier: https://github.com/eifinger/hass-weenect", + "description": "Wenn du Hilfe benötigst findest du sie in der [Weenect Dokumentation]({docs_url})", "data": { "username": "Benutzername", "password": "Passwort" diff --git a/custom_components/weenect/translations/en.json b/custom_components/weenect/translations/en.json index da8c307..966aa1b 100644 --- a/custom_components/weenect/translations/en.json +++ b/custom_components/weenect/translations/en.json @@ -2,7 +2,7 @@ "config": { "step": { "user": { - "description": "If you need help with the configuration have a look here: https://github.com/eifinger/hass-weenect", + "description": "If you need help with the configuration have a look in the [Weenect documentation]({docs_url})", "data": { "username": "Username", "password": "Password"