diff --git a/homeassistant/components/tradfri/config_flow.py b/homeassistant/components/tradfri/config_flow.py index 20dc2ed9510..1e9b63bb325 100644 --- a/homeassistant/components/tradfri/config_flow.py +++ b/homeassistant/components/tradfri/config_flow.py @@ -108,30 +108,6 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): self._host = host return await self.async_step_auth() - async def async_step_import(self, user_input: dict[str, Any]) -> FlowResult: - """Import a config entry.""" - self._async_abort_entries_match({CONF_HOST: user_input["host"]}) - - # Happens if user has host directly in configuration.yaml - if "key" not in user_input: - self._host = user_input["host"] - return await self.async_step_auth() - - try: - data = await get_gateway_info( - self.hass, - user_input["host"], - # Old config format had a fixed identity - user_input.get("identity", "homeassistant"), - user_input["key"], - ) - - return await self._entry_from_data(data) - except AuthError: - # If we fail to connect, just pass it on to discovery - self._host = user_input["host"] - return await self.async_step_auth() - async def _entry_from_data(self, data: dict[str, Any]) -> FlowResult: """Create an entry from data.""" host = data[CONF_HOST] diff --git a/tests/components/tradfri/test_config_flow.py b/tests/components/tradfri/test_config_flow.py index 15ca17e003f..9eff7335820 100644 --- a/tests/components/tradfri/test_config_flow.py +++ b/tests/components/tradfri/test_config_flow.py @@ -164,20 +164,6 @@ async def test_discovery_duplicate_aborted(hass: HomeAssistant) -> None: assert entry.data["host"] == "new-host" -async def test_import_duplicate_aborted(hass: HomeAssistant) -> None: - """Test a duplicate import host is ignored.""" - MockConfigEntry(domain="tradfri", data={"host": "some-host"}).add_to_hass(hass) - - flow = await hass.config_entries.flow.async_init( - "tradfri", - context={"source": config_entries.SOURCE_IMPORT}, - data={"host": "some-host"}, - ) - - assert flow["type"] == data_entry_flow.FlowResultType.ABORT - assert flow["reason"] == "already_configured" - - async def test_duplicate_discovery( hass: HomeAssistant, mock_auth, mock_entry_setup ) -> None: