diff --git a/homeassistant/components/esphome/config_flow.py b/homeassistant/components/esphome/config_flow.py index d9c8381e4ff..d727aefa6ef 100644 --- a/homeassistant/components/esphome/config_flow.py +++ b/homeassistant/components/esphome/config_flow.py @@ -323,7 +323,9 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN): ): return assert conflict_entry.unique_id is not None - if updates: + if self.source == SOURCE_RECONFIGURE: + error = "reconfigure_already_configured" + elif updates: error = "already_configured_updates" else: error = "already_configured_detailed" diff --git a/homeassistant/components/esphome/strings.json b/homeassistant/components/esphome/strings.json index f96a939588a..bc198d514ab 100644 --- a/homeassistant/components/esphome/strings.json +++ b/homeassistant/components/esphome/strings.json @@ -4,6 +4,7 @@ "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "already_configured_detailed": "A device `{name}`, with MAC address `{mac}` is already configured as `{title}`.", "already_configured_updates": "A device `{name}`, with MAC address `{mac}` is already configured as `{title}`; the existing configuration will be updated with the validated data.", + "reconfigure_already_configured": "A device `{name}` with MAC address `{mac}` is already configured as `{title}`. Reconfiguration was aborted because the new configuration appears to refer to a different device.", "already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]", "reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]", "mdns_missing_mac": "Missing MAC address in mDNS properties.", diff --git a/tests/components/esphome/test_config_flow.py b/tests/components/esphome/test_config_flow.py index 3f948076d2e..752f980cd87 100644 --- a/tests/components/esphome/test_config_flow.py +++ b/tests/components/esphome/test_config_flow.py @@ -2228,7 +2228,7 @@ async def test_reconfig_mac_used_by_other_entry( ) assert result["type"] is FlowResultType.ABORT - assert result["reason"] == "already_configured_updates" + assert result["reason"] == "reconfigure_already_configured" assert result["description_placeholders"] == { "title": "Mock Title", "name": "test4",