-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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 reauth for missing token scope in Husqvarna Automower #117098
Add reauth for missing token scope in Husqvarna Automower #117098
Conversation
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
translation_key="wrong_scope", | ||
data={"entry_id": entry.entry_id}, | ||
) | ||
entry.async_start_reauth(hass) |
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.
We can raise ConfigEntryAuthFailed
.
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 that be to restrictive? Because in this case the integration would fail to setup. But the integration would still work without that token scope, only some functions won't.
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.
Ok. Then please add a code comment here explaining why we don't raise.
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 reading the linked issue and it seems not having the websocket will create unexpected behavior and problems. Why should we allow to use the integration without the websocket?
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 thought it's better for the user. If the user updates its HA instance, the the integration is more or less broken, until he finds time to reauthenticate. And so he can at least use the integration with polling every 8 minutes. But if you think it's better to raise ConfigEntryAuthFailed
we can do so.
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's better to have things behave predictably. The docs say you should activate both APIs, so most users will probably have done that already.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.
Thanks!
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.
One additional question.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
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.
Thanks!
Breaking change
Proposed change
Authentication API
and theAutomower Connect API
. If they only connect to theAuthentication API
only polling works but the websockets connection can't be established. Maybe it's also related that some users can't send commands to their device.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
..coveragerc
.To help with the load of incoming pull requests: