Conversation
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
|
@copilot the min version is already 2026.3.2 |
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the integration blueprint to use a patched Home Assistant baseline (addressing the cited stored XSS in older cores) and adds a config-entry reconfigure flow so existing entries can update credentials without deletion.
Changes:
- Bump
homeassistantminimum/dev dependency from2025.2.4to2026.3.2inrequirements.txtandhacs.json. - Add
async_step_reconfigureto the integration config flow to validate and persist updated credentials. - Add reconfigure step + abort translation strings in
translations/en.json.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| requirements.txt | Raises the Home Assistant dependency version to a patched/minimum baseline. |
| hacs.json | Aligns HACS minimum Home Assistant version with the bumped baseline. |
| custom_components/integration_blueprint/config_flow.py | Introduces a reconfigure step that validates credentials and updates the existing entry. |
| custom_components/integration_blueprint/translations/en.json | Adds UI strings for the new reconfigure step and success abort reason. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| vol.Required( | ||
| CONF_USERNAME, | ||
| default=reconfigure_entry.data.get( | ||
| CONF_USERNAME, vol.UNDEFINED | ||
| ), |
There was a problem hiding this comment.
The reconfigure form allows changing CONF_USERNAME, but the config entry’s title and unique_id are originally derived from the username in async_step_user and are not updated here. If the user changes the username during reconfigure, the entry will keep the old title/unique_id while storing new credentials, and it may also bypass the duplicate-prevention logic tied to the unique_id. Consider either making username non-editable for reconfigure (only update password), or explicitly updating title/unique_id and handling collisions when the username changes.
| self._get_reconfigure_entry(), | ||
| data_updates=user_input, | ||
| ) | ||
|
|
||
| reconfigure_entry = self._get_reconfigure_entry() |
There was a problem hiding this comment.
self._get_reconfigure_entry() is called twice in the same execution path (once for async_update_reload_and_abort, and again for building the form). Store it in a local variable once to avoid repeated lookups and keep the control flow simpler.
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
|
@copilot adjust the or title and description to reflect the changes |
Per the 2025-03-01 config flow unique ID guidelines, integrations with unique IDs should offer a reconfigure flow so users can update credentials without deleting and re-adding the entry.
Changes
async_step_reconfiguretoconfig_flow.py— pre-fills username from the existing entry, validates new credentials, then callsasync_update_reload_and_aborton successreconfigurestep translations andreconfigure_successfulabort string totranslations/en.json⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.