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

Code before:
                # Validate new credentials against the configured host
                data = {
                    CONF_HOST: reauth_entry.data[CONF_HOST],
                    CONF_USERNAME: user_input[CONF_USERNAME],
                    CONF_PASSWORD: user_input[CONF_PASSWORD],
                    CONF_VERIFY_SSL: reauth_entry.data.get(CONF_VERIFY_SSL, False),
                }
                info = await validate_input(self.hass, data)
            except CannotConnect:
                errors["base"] = "cannot_connect"
            except InvalidAuth:
                errors["base"] = "invalid_auth"
            except Exception:
                _LOGGER.exception("Unexpected exception during reauth")
                errors["base"] = "unknown"
            else:
                # Verify reauth is for the same device
                await self.async_set_unique_id(info["device_id"])
                self._abort_if_unique_id_mismatch(reason="wrong_account")

                return self.async_update_reload_and_abort(
                    reauth_entry,
                    data_updates={
                        CONF_USERNAME: user_input[CONF_USERNAME],
                        CONF_PASSWORD: user_input[CONF_PASSWORD],
                    },
                )

        return self.async_show_form(
            step_id="reauth_confirm",
            data_schema=vol.Schema(
                {
                    vol.Required(
                        CONF_USERNAME, default=reauth_entry.data[CONF_USERNAME]
                    ): str,
                    vol.Required(CONF_PASSWORD): str,
                }
            ),
            errors=errors,
            description_placeholders={
                "name": reauth_entry.title,
                "host": reauth_entry.data[CONF_HOST],
            },
        )

    async def async_step_dhcp(
        self, discovery_info: DhcpServiceInfo
    ) -> ConfigFlowResult:
        """Handle DHCP discovery."""
        host = discovery_info.ip


Review comment (suggestion):
```suggestion
                    data_updates=user_input,
```
you only have that data in there, so you can just pass the entire dict

Code after:
                CONF_HOST: reauth_entry.data[CONF_HOST],
                CONF_USERNAME: user_input[CONF_USERNAME],
                CONF_PASSWORD: user_input[CONF_PASSWORD],
                CONF_VERIFY_SSL: reauth_entry.data.get(CONF_VERIFY_SSL, False),
            }
            try:
                # Validate new credentials against the configured host
                info = await validate_input(self.hass, data)
            except CannotConnect:
                errors["base"] = "cannot_connect"
            except InvalidAuth:
                errors["base"] = "invalid_auth"
            except Exception:
                _LOGGER.exception("Unexpected exception during reauth")
                errors["base"] = "unknown"
            else:
                # Verify reauth is for the same device
                await self.async_set_unique_id(info["device_id"])
                self._abort_if_unique_id_mismatch(reason="wrong_account")

                return self.async_update_reload_and_abort(
                    reauth_entry,
                    data_updates=user_input,
                )

        reauth_schema = vol.Schema(
            {
                vol.Required(CONF_USERNAME): str,
                vol.Required(CONF_PASSWORD): str,
            }
        )

        suggested = {**reauth_entry.data, **(user_input or {})}

        return self.async_show_form(
            step_id="reauth_confirm",
            data_schema=self.add_suggested_values_to_schema(reauth_schema, suggested),
            errors=errors,
            description_placeholders={
                "name": reauth_entry.title,
                "host": reauth_entry.data[CONF_HOST],
            },
        )

    async def async_step_dhcp(
        self, discovery_info: DhcpServiceInfo
    ) -> ConfigFlowResult:
        """Handle DHCP discovery."""
        host = discovery_info.ip

        # Store discovered host for later use