diff --git a/homeassistant/components/unifiprotect/config_flow.py b/homeassistant/components/unifiprotect/config_flow.py index 3039d5153e5..bd66b5f086a 100644 --- a/homeassistant/components/unifiprotect/config_flow.py +++ b/homeassistant/components/unifiprotect/config_flow.py @@ -116,9 +116,6 @@ class ProtectFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): self.hass.config_entries.async_update_entry( entry, data={**entry.data, CONF_HOST: new_host} ) - self.hass.async_create_task( - self.hass.config_entries.async_reload(entry.entry_id) - ) return self.async_abort(reason="already_configured") if entry_host in (direct_connect_domain, source_ip) or ( entry_has_direct_connect diff --git a/tests/components/unifiprotect/test_config_flow.py b/tests/components/unifiprotect/test_config_flow.py index 4c7f12a69fa..78931aa460a 100644 --- a/tests/components/unifiprotect/test_config_flow.py +++ b/tests/components/unifiprotect/test_config_flow.py @@ -365,10 +365,7 @@ async def test_discovered_by_unifi_discovery_direct_connect_updated( ) mock_config.add_to_hass(hass) - with _patch_discovery(), patch( - "homeassistant.components.unifiprotect.async_setup_entry", - return_value=True, - ) as mock_setup_entry: + with _patch_discovery(): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, @@ -378,7 +375,6 @@ async def test_discovered_by_unifi_discovery_direct_connect_updated( assert result["type"] == RESULT_TYPE_ABORT assert result["reason"] == "already_configured" - assert len(mock_setup_entry.mock_calls) == 1 assert mock_config.data[CONF_HOST] == DIRECT_CONNECT_DOMAIN @@ -401,10 +397,7 @@ async def test_discovered_by_unifi_discovery_direct_connect_updated_but_not_usin ) mock_config.add_to_hass(hass) - with _patch_discovery(), patch( - "homeassistant.components.unifiprotect.async_setup_entry", - return_value=True, - ) as mock_setup_entry: + with _patch_discovery(): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_INTEGRATION_DISCOVERY}, @@ -414,7 +407,6 @@ async def test_discovered_by_unifi_discovery_direct_connect_updated_but_not_usin assert result["type"] == RESULT_TYPE_ABORT assert result["reason"] == "already_configured" - assert len(mock_setup_entry.mock_calls) == 1 assert mock_config.data[CONF_HOST] == "127.0.0.1"