Skip to content

Commit 8f94657

Browse files
MartinHjelmarefrenck
authored andcommitted
Improve Z-Wave manual config flow step description (home-assistant#150479)
1 parent b0ab3cd commit 8f94657

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

homeassistant/components/zwave_js/config_flow.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,16 @@
8888
CONF_ADDON_LR_S2_AUTHENTICATED_KEY: CONF_LR_S2_AUTHENTICATED_KEY,
8989
}
9090

91+
EXAMPLE_SERVER_URL = "ws://localhost:3000"
9192
ON_SUPERVISOR_SCHEMA = vol.Schema({vol.Optional(CONF_USE_ADDON, default=True): bool})
9293
MIN_MIGRATION_SDK_VERSION = AwesomeVersion("6.61")
9394

9495
NETWORK_TYPE_NEW = "new"
9596
NETWORK_TYPE_EXISTING = "existing"
97+
ZWAVE_JS_SERVER_INSTRUCTIONS = (
98+
"https://www.home-assistant.io/integrations/zwave_js/"
99+
"#advanced-installation-instructions"
100+
)
96101
ZWAVE_JS_UI_MIGRATION_INSTRUCTIONS = (
97102
"https://www.home-assistant.io/integrations/zwave_js/"
98103
"#how-to-migrate-from-one-adapter-to-a-new-adapter-using-z-wave-js-ui"
@@ -529,7 +534,12 @@ async def async_step_manual(
529534
"""Handle a manual configuration."""
530535
if user_input is None:
531536
return self.async_show_form(
532-
step_id="manual", data_schema=get_manual_schema({})
537+
step_id="manual",
538+
data_schema=get_manual_schema({}),
539+
description_placeholders={
540+
"example_server_url": EXAMPLE_SERVER_URL,
541+
"server_instructions": ZWAVE_JS_SERVER_INSTRUCTIONS,
542+
},
533543
)
534544

535545
errors = {}
@@ -558,7 +568,13 @@ async def async_step_manual(
558568
return self._async_create_entry_from_vars()
559569

560570
return self.async_show_form(
561-
step_id="manual", data_schema=get_manual_schema(user_input), errors=errors
571+
step_id="manual",
572+
data_schema=get_manual_schema(user_input),
573+
description_placeholders={
574+
"example_server_url": EXAMPLE_SERVER_URL,
575+
"server_instructions": ZWAVE_JS_SERVER_INSTRUCTIONS,
576+
},
577+
errors=errors,
562578
)
563579

564580
async def async_step_hassio(
@@ -1016,6 +1032,10 @@ async def async_step_manual_reconfigure(
10161032
return self.async_show_form(
10171033
step_id="manual_reconfigure",
10181034
data_schema=get_manual_schema({CONF_URL: config_entry.data[CONF_URL]}),
1035+
description_placeholders={
1036+
"example_server_url": EXAMPLE_SERVER_URL,
1037+
"server_instructions": ZWAVE_JS_SERVER_INSTRUCTIONS,
1038+
},
10191039
)
10201040

10211041
errors = {}
@@ -1046,6 +1066,10 @@ async def async_step_manual_reconfigure(
10461066
return self.async_show_form(
10471067
step_id="manual_reconfigure",
10481068
data_schema=get_manual_schema(user_input),
1069+
description_placeholders={
1070+
"example_server_url": EXAMPLE_SERVER_URL,
1071+
"server_instructions": ZWAVE_JS_SERVER_INSTRUCTIONS,
1072+
},
10491073
errors=errors,
10501074
)
10511075

homeassistant/components/zwave_js/strings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,21 @@
8282
"title": "Installing add-on"
8383
},
8484
"manual": {
85+
"description": "The Z-Wave integration requires a running Z-Wave Server. If you don't already have that set up, please read the [instructions]({server_instructions}) in our documentation.\n\nWhen you have a Z-Wave Server running, enter its URL below to allow the integration to connect.",
8586
"data": {
8687
"url": "[%key:common::config_flow::data::url%]"
88+
},
89+
"data_description": {
90+
"url": "The URL of the Z-Wave Server WebSocket API, e.g. {example_server_url}"
8791
}
8892
},
8993
"manual_reconfigure": {
94+
"description": "[%key:component::zwave_js::config::step::manual::description%]",
9095
"data": {
9196
"url": "[%key:common::config_flow::data::url%]"
97+
},
98+
"data_description": {
99+
"url": "[%key:component::zwave_js::config::step::manual::data_description::url%]"
92100
}
93101
},
94102
"on_supervisor": {

0 commit comments

Comments
 (0)