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

Code before:
            step_id="user",
            data_schema=AUTH_SCHEMA,
            errors=errors,
        )

    async def async_step_zeroconf(
        self, discovery_info: ZeroconfServiceInfo
    ) -> ConfigFlowResult:
        """Handle zeroconf discovery."""

        # Ensure that an IPv4 address is received
        self._host = discovery_info.host
        self._name = discovery_info.hostname[6:18]
        if discovery_info.ip_address.version == 6:
            return self.async_abort(reason="ipv6_address")

        # If an already configured homee reports with a second IP, abort.
        existing_entry = await self.async_set_unique_id(self._name)
        if (
            existing_entry
            and existing_entry.state == ConfigEntryState.LOADED
            and existing_entry.runtime_data.connected
            and existing_entry.data[CONF_HOST] != self._host
        ):
            _LOGGER.debug(
                "Aborting config flow for discovered homee with IP %s"
                "since it is already configured at IP %s",
                self._host,
                existing_entry.data[CONF_HOST],
            )
            return self.async_abort(reason="2nd_ip_address")

        self._abort_if_unique_id_configured(updates={CONF_HOST: self._host})

        # Cause an auth-error to see if homee is reachable.
        self.homee = Homee(
            self._host,
            "dummy_username",
            "dummy_password",
        )
        errors = await self._connect_homee()
        if errors["base"] != RESULT_INVALID_AUTH:
            return self.async_abort(reason=RESULT_CANNOT_CONNECT)

        self.context["title_placeholders"] = {"name": self._name, "host": self._host}

        return await self.async_step_zeroconf_confirm()

    async def async_step_zeroconf_confirm(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult:

Review comment (suggestion):
```suggestion
                "Aborting config flow for discovered homee with IP %s "
```

Code after:
            step_id="user",
            data_schema=AUTH_SCHEMA,
            errors=errors,
        )

    async def async_step_zeroconf(
        self, discovery_info: ZeroconfServiceInfo
    ) -> ConfigFlowResult:
        """Handle zeroconf discovery."""

        # Ensure that an IPv4 address is received
        self._host = discovery_info.host
        self._name = discovery_info.hostname[6:18]
        if discovery_info.ip_address.version == 6:
            return self.async_abort(reason="ipv6_address")

        # If an already configured homee reports with a second IP, abort.
        existing_entry = await self.async_set_unique_id(self._name)
        if (
            existing_entry
            and existing_entry.state == ConfigEntryState.LOADED
            and existing_entry.runtime_data.connected
            and existing_entry.data[CONF_HOST] != self._host
        ):
            _LOGGER.debug(
                "Aborting config flow for discovered homee with IP %s "
                "since it is already configured at IP %s",
                self._host,
                existing_entry.data[CONF_HOST],
            )
            return self.async_abort(reason="2nd_ip_address")

        self._abort_if_unique_id_configured(updates={CONF_HOST: self._host})

        # Cause an auth-error to see if homee is reachable.
        self.homee = Homee(
            self._host,
            "dummy_username",
            "dummy_password",
        )
        errors = await self._connect_homee()
        if errors["base"] != RESULT_INVALID_AUTH:
            return self.async_abort(reason=RESULT_CANNOT_CONNECT)

        self.context["title_placeholders"] = {"name": self._name, "host": self._host}

        return await self.async_step_zeroconf_confirm()

    async def async_step_zeroconf_confirm(
        self, user_input: dict[str, Any] | None = None
    ) -> ConfigFlowResult: