From d96bc1b32e29c27e111d9836324ba07e3a3d0e7c Mon Sep 17 00:00:00 2001 From: AlCalzone Date: Tue, 27 Jan 2026 19:15:02 +0100 Subject: [PATCH] Clarify what is being discovered by the Z-Wave integration (#161626) --- homeassistant/components/zwave_js/config_flow.py | 11 ++++++++++- homeassistant/components/zwave_js/strings.json | 2 +- tests/components/zwave_js/test_config_flow.py | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zwave_js/config_flow.py b/homeassistant/components/zwave_js/config_flow.py index 81603392730..d02ef755c20 100644 --- a/homeassistant/components/zwave_js/config_flow.py +++ b/homeassistant/components/zwave_js/config_flow.py @@ -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( diff --git a/homeassistant/components/zwave_js/strings.json b/homeassistant/components/zwave_js/strings.json index 4170fb4a594..8b734fbb0c5 100644 --- a/homeassistant/components/zwave_js/strings.json +++ b/homeassistant/components/zwave_js/strings.json @@ -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", diff --git a/tests/components/zwave_js/test_config_flow.py b/tests/components/zwave_js/test_config_flow.py index 8c03f90f555..d65c0702d64 100644 --- a/tests/components/zwave_js/test_config_flow.py +++ b/tests/components/zwave_js/test_config_flow.py @@ -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