diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index ec0a559c76f..f9e72a723a4 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -1278,7 +1278,13 @@ class ConfigEntriesFlowManager( # a single config entry, but which already has an entry if ( source not in {SOURCE_IGNORE, SOURCE_REAUTH, SOURCE_RECONFIGURE} - and self.config_entries.async_has_entries(handler, include_ignore=False) + and ( + self.config_entries.async_has_entries(handler, include_ignore=False) + or ( + self.config_entries.async_has_entries(handler, include_ignore=True) + and source != SOURCE_USER + ) + ) and await _support_single_config_entry_only(self.hass, handler) ): return ConfigFlowResult( diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 5a95b9c5712..e99063b088b 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -444,7 +444,7 @@ async def test_hassio_ignored(hass: HomeAssistant) -> None: ) assert result assert result.get("type") is FlowResultType.ABORT - assert result.get("reason") == "already_configured" + assert result.get("reason") == "single_instance_allowed" async def test_hassio_confirm( diff --git a/tests/test_config_entries.py b/tests/test_config_entries.py index 822dca559a8..700840eb90e 100644 --- a/tests/test_config_entries.py +++ b/tests/test_config_entries.py @@ -5729,6 +5729,14 @@ async def test_starting_config_flow_on_single_config_entry( None, {"type": data_entry_flow.FlowResultType.ABORT, "reason": "not_implemented"}, ), + ( + {"source": config_entries.SOURCE_ZEROCONF}, + None, + { + "type": data_entry_flow.FlowResultType.ABORT, + "reason": "single_instance_allowed", + }, + ), ], ) async def test_starting_config_flow_on_single_config_entry_2(