Repository: home-assistant/core
File: homeassistant/components/airos/config_flow.py (Python)

Code before:
        current_entry = next(
            (
                entry
                for entry in self._async_current_entries()
                if entry.unique_id == normalized_mac
            ),
            None,
        )
        if current_entry is None:
            return self.async_abort(reason="no_devices_found")

        if current_entry.data[CONF_HOST] == ip_address:
            return self.async_abort(reason="already_configured")

        updated_data = {**current_entry.data, CONF_HOST: ip_address}

        self.hass.config_entries.async_update_entry(current_entry, data=updated_data)
        await self.hass.config_entries.async_reload(current_entry.entry_id)

        _LOGGER.info(
            "DHCP airOS device with mac address %s has new ip address %s, updating config entry accordingly",
            normalized_mac,
            ip_address,
        )

        return self.async_abort(reason="reconfigure_successful")

    async def async_step_discovery_no_devices(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery finds no (unconfigured) devices."""
        return self.async_abort(reason="no_devices_found")

    async def async_step_discovery_listen_error(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery is unable to listen on the port."""
        return self.async_abort(reason="listen_error")

    async def async_step_discovery_detect_error(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery receives incorrect broadcasts."""
        return self.async_abort(reason="detect_error")

    async def async_step_discovery_failed(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery fails for other reasons."""
        return self.async_abort(reason="discovery_failed")


Review comment (suggestion):
```suggestion
        self._abort_if_unique_id_configured(updates={CONF_HOST: ip_address})
        return self.async_abort(reason="unreachable")
```
Does the same :)

Code after:
        self._abort_if_unique_id_configured(updates={CONF_HOST: ip_address})
        return self.async_abort(reason="unreachable")

    async def async_step_discovery_no_devices(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery finds no (unconfigured) devices."""
        return self.async_abort(reason="no_devices_found")

    async def async_step_discovery_listen_error(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery is unable to listen on the port."""
        return self.async_abort(reason="listen_error")

    async def async_step_discovery_detect_error(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery receives incorrect broadcasts."""
        return self.async_abort(reason="detect_error")

    async def async_step_discovery_failed(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:
        """Abort if discovery fails for other reasons."""
        return self.async_abort(reason="discovery_failed")