-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Raise ConfigEntryAuthFailed
at Home Connect update auth error
#136953
base: dev
Are you sure you want to change the base?
Raise ConfigEntryAuthFailed
at Home Connect update auth error
#136953
Conversation
Hey there @DavidMStraub, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -22,6 +22,9 @@ | |||
} | |||
}, | |||
"exceptions": { | |||
"auth_error": { |
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.
Wouldn't it be better to implement a reauth flow than asking the user to delete and readd the integration?
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.
Sure, in the PR description I mentioned that I tried, but after completing the reauth, a new config entry is created
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 think it worth trying to fix that than asking the user to delete and readd the integration
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.
Sure it is, I posted the PR like this with the idea of asking for help.
Do you have any suggestion about how to reconfigure the config entry based on its own 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.
Here's the docs. Update the config flow following that example.
https://developers.home-assistant.io/docs/config_entries_config_flow_handler#reauthentication
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.
If there's no unique id we should only allow a single config entry.
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.
Here's how to only allow a single config entry:
https://developers.home-assistant.io/docs/creating_integration_manifest/#single-config-entry-only
I think a single config entry should be enough. It's hard to imagine when you would need to set up more than one user account in the same home.
@Diegorro98 can you reach out to me on Discord? I have a question about an issue when I'm testing my device. |
Proposed change
Raise
ConfigEntryAuthFailed
to inform the user about how to solve the issue when there is an authentication error from the Home Connect API.I tried to add a reauth flow, but because the configuration entries cannot be uniquely identified (there is no known identifiers such user id, email, etc.) so the integration needs to be deleted and added back again.
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: