data grand lyon: implement reauth#170059
Merged
zweckj merged 1 commit intoMay 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a reauthentication path for the data_grand_lyon integration so Home Assistant can prompt the user to re-enter credentials when the upstream service returns an authorization error.
Changes:
- Raise
ConfigEntryAuthFailedfrom the coordinator on HTTP 401/403 responses to trigger a reauth flow. - Add
reauth/reauth_confirmsteps to the integration config flow and related translations. - Add/extend tests to validate both setup-triggered reauth and the reauth config flow (success + error paths), and mark the quality scale rule as done.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/data_grand_lyon/coordinator.py |
Detects auth failures (401/403) during updates and raises ConfigEntryAuthFailed to trigger reauth. |
homeassistant/components/data_grand_lyon/config_flow.py |
Implements async_step_reauth / async_step_reauth_confirm to update credentials via UI. |
homeassistant/components/data_grand_lyon/strings.json |
Adds translation keys for reauth step and success abort reason. |
homeassistant/components/data_grand_lyon/quality_scale.yaml |
Marks the reauthentication-flow rule as completed. |
tests/components/data_grand_lyon/test_init.py |
Adds a test asserting setup triggers a reauth flow on auth failure. |
tests/components/data_grand_lyon/test_config_flow.py |
Adds tests for reauth flow success and error handling/recovery. |
zweckj
approved these changes
May 8, 2026
Comment on lines
+106
to
+109
| with patch( | ||
| "homeassistant.components.data_grand_lyon.config_flow.DataGrandLyonClient.get_tcl_passages", | ||
| return_value=[], | ||
| ): |
Member
There was a problem hiding this comment.
because the rest of the file already uses that syntax, I will let it slide, but it would be better to use a fixture for that instead, to reduce indent and save code
Contributor
Author
There was a problem hiding this comment.
Thank you for the feedback, I’ll clean that up in a future PR.
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Implement reauth flow for data grand lyon.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: