mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 17:49:37 +01:00
Clarify what is being discovered by the Z-Wave integration (#161626)
This commit is contained in:
@@ -469,7 +469,16 @@ class ZWaveJSConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
self._abort_if_unique_id_configured()
|
||||
self.ws_address = f"ws://{discovery_info.host}:{discovery_info.port}"
|
||||
home_id_display = format_home_id_for_display(int(home_id))
|
||||
self.context.update({"title_placeholders": {CONF_NAME: home_id_display}})
|
||||
# Show home ID and network location in discovery notification
|
||||
self.context.update(
|
||||
{
|
||||
"title_placeholders": {
|
||||
"host": discovery_info.host,
|
||||
"port": str(discovery_info.port),
|
||||
"home_id": home_id_display,
|
||||
}
|
||||
}
|
||||
)
|
||||
return await self.async_step_zeroconf_confirm()
|
||||
|
||||
async def async_step_zeroconf_confirm(
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"invalid_ws_url": "Invalid websocket URL",
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
},
|
||||
"flow_title": "{name}",
|
||||
"flow_title": "Network {home_id} at {host}:{port}",
|
||||
"progress": {
|
||||
"backup_nvm": "Please wait while the network backup completes",
|
||||
"install_addon": "Installation can take several minutes",
|
||||
|
||||
@@ -4055,6 +4055,14 @@ async def test_zeroconf(hass: HomeAssistant) -> None:
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "zeroconf_confirm"
|
||||
|
||||
# Verify discovery notification shows home ID with network location
|
||||
flows = hass.config_entries.flow.async_progress()
|
||||
assert len(flows) == 1
|
||||
flow = flows[0]
|
||||
assert flow["context"]["title_placeholders"]["host"] == "127.0.0.1"
|
||||
assert flow["context"]["title_placeholders"]["port"] == "3000"
|
||||
assert flow["context"]["title_placeholders"]["home_id"] == "0x000004d2" # 1234
|
||||
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.zwave_js.async_setup", return_value=True
|
||||
|
||||
Reference in New Issue
Block a user