mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 07:05:48 +01:00
Move out URL of Xiaomy_aquara from strings.json (#157937)
Co-authored-by: Michelle "MishManners®™" Duke <36594527+mishmanners@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,11 @@ GATEWAY_SETTINGS = vol.Schema(
|
||||
}
|
||||
)
|
||||
|
||||
ERROR_STEP_PLACEHOLDERS = {
|
||||
"tutorial_url": "https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)#Adding_the_Xiaomi_Gateway_to_Domoticz",
|
||||
"invalid_host_url": "https://www.home-assistant.io/integrations/xiaomi_aqara/#connection-problem",
|
||||
}
|
||||
|
||||
|
||||
class XiaomiAqaraFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a Xiaomi Aqara config flow."""
|
||||
@@ -66,7 +71,12 @@ class XiaomiAqaraFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
if (self.host is None and self.sid is None) or errors:
|
||||
schema = GATEWAY_CONFIG_HOST
|
||||
|
||||
return self.async_show_form(step_id="user", data_schema=schema, errors=errors)
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=schema,
|
||||
errors=errors,
|
||||
description_placeholders=ERROR_STEP_PLACEHOLDERS,
|
||||
)
|
||||
|
||||
async def async_step_user(
|
||||
self, user_input: dict[str, Any] | None = None
|
||||
@@ -149,7 +159,10 @@ class XiaomiAqaraFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="select", data_schema=select_schema, errors=errors
|
||||
step_id="select",
|
||||
data_schema=select_schema,
|
||||
errors=errors,
|
||||
description_placeholders=ERROR_STEP_PLACEHOLDERS,
|
||||
)
|
||||
|
||||
async def async_step_zeroconf(
|
||||
@@ -236,5 +249,8 @@ class XiaomiAqaraFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
errors[CONF_KEY] = "invalid_key"
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="settings", data_schema=GATEWAY_SETTINGS, errors=errors
|
||||
step_id="settings",
|
||||
data_schema=GATEWAY_SETTINGS,
|
||||
errors=errors,
|
||||
description_placeholders=ERROR_STEP_PLACEHOLDERS,
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"error": {
|
||||
"discovery_error": "Failed to discover a Xiaomi Aqara Gateway, try using the IP of the device running Home Assistant as interface",
|
||||
"invalid_host": "Invalid hostname or IP address, see https://www.home-assistant.io/integrations/xiaomi_aqara/#connection-problem",
|
||||
"invalid_host": "Invalid hostname or IP address, see {invalid_host_url}",
|
||||
"invalid_interface": "Invalid network interface",
|
||||
"invalid_key": "Invalid Gateway key",
|
||||
"invalid_mac": "Invalid MAC address"
|
||||
@@ -25,7 +25,7 @@
|
||||
"key": "The key of your Gateway",
|
||||
"name": "Name of the Gateway"
|
||||
},
|
||||
"description": "The key (password) can be retrieved using this tutorial: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)#Adding_the_Xiaomi_Gateway_to_Domoticz. If the key is not provided only sensors will be accessible",
|
||||
"description": "The key (password) can be retrieved using this tutorial: {tutorial_url}. If the key is not provided only sensors will be accessible",
|
||||
"title": "Optional settings"
|
||||
},
|
||||
"user": {
|
||||
|
||||
Reference in New Issue
Block a user