Reauth form does not pre-fill existing username/region/base_url #4

Closed
opened 2026-05-09 05:10:08 +00:00 by Mark · 1 comment
Owner

Severity: Low (UX)

File: custom_components/yeedi/config_flow.py, lines 96-104

Issue: The async_step_reauth_confirm method shows a blank form on reauthentication, requiring the user to re-enter their username, region, and base URL from scratch. Since the config entry already has this data, the form should pre-fill those fields for a smoother UX.

Fix: Pass default=entry.data.get(...) values to the schema, similar to how the options flow does it. Also consider showing the existing username as a read-only field since it cannot be changed.

entry = self._reauth_entry
schema = vol.Schema(
    {
        vol.Required(CONF_USERNAME, default=entry.data.get(CONF_USERNAME, "")): str,
        vol.Required(CONF_PASSWORD): str,
        vol.Optional(CONF_REGION, default=entry.data.get(CONF_REGION, "")): str,
        vol.Optional(CONF_BASE_URL, default=entry.data.get(CONF_BASE_URL, "")): str,
    }
)
**Severity:** Low (UX) **File:** `custom_components/yeedi/config_flow.py`, lines 96-104 **Issue:** The `async_step_reauth_confirm` method shows a blank form on reauthentication, requiring the user to re-enter their username, region, and base URL from scratch. Since the config entry already has this data, the form should pre-fill those fields for a smoother UX. **Fix:** Pass `default=entry.data.get(...)` values to the schema, similar to how the options flow does it. Also consider showing the existing username as a read-only field since it cannot be changed. ```python entry = self._reauth_entry schema = vol.Schema( { vol.Required(CONF_USERNAME, default=entry.data.get(CONF_USERNAME, "")): str, vol.Required(CONF_PASSWORD): str, vol.Optional(CONF_REGION, default=entry.data.get(CONF_REGION, "")): str, vol.Optional(CONF_BASE_URL, default=entry.data.get(CONF_BASE_URL, "")): str, } ) ```
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-12 01:43:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/yeedi_awmbuild#4
No description provided.