Skip to content
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 support for reauth flow #301

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

functionpointer
Copy link
Contributor

With #298 merged, we should also add support for the reauthentication flow.

This PR also simplifies exception management on initial poll, by using HA's built-in async_config_entry_first_refresh() function.
It will automatically raise ConfigEntryNotReady when an error occurs. This allows us to remove a big try: block.

@vinteo vinteo requested a review from EdLeckert August 2, 2024 11:53
Copy link
Collaborator

@EdLeckert EdLeckert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work fine. The result reason displayed in the dialog by async_abort seems a little rough, but I see that it is fairly common practice to do it this way.

image

Another thing I noticed that has probably been this way for a while is that a non-existent URL does not trigger an InvalidURL exception. Instead, it results in a timeout that displays as Unexpected error. Might want to look into that at some point.

@vinteo
Copy link
Owner

vinteo commented Aug 5, 2024

Copy link

sonarqubecloud bot commented Aug 5, 2024

@vinteo
Copy link
Owner

vinteo commented Aug 5, 2024

thanks again

@vinteo vinteo merged commit b00e22f into vinteo:master Aug 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants