-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new helper for matching reauth/reconfigure config flows #127565
base: dev
Are you sure you want to change the base?
Conversation
Hey there @frenck, @joostlek, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
self.source == SOURCE_REAUTH | ||
and self._get_reauth_entry().unique_id != self.unique_id | ||
) or ( | ||
self.source == SOURCE_RECONFIGURE | ||
and self._get_reconfigure_entry().unique_id != self.unique_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should assume the unique ID is being used for detecting these cases.
Can you elaborate on that? There is nothing in the PR description that explain the foundation behind it. |
It's a pattern I've bumped into a few times. Axis and abode for example use this pattern. |
It's also partially linked to #127527 |
Breaking change
Proposed change
As we seek to prevent reauth/reconfigure flows from creating new entries, whilst at the same time preventing reauth/reconfigurations from updating other entries, I think it makes sense to add this helper.
TODO:add tests (90b6766)TODO:add documentation Document _abort_if_unique_id_mismatch helper developers.home-assistant#2353Type 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: