-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
Add microBees integration #99573
Add microBees integration #99573
Conversation
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.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. 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.
limited included platforms to a single platform
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.
Please address the comments in a new PR. Thanks!
from homeassistant.helpers import config_entry_oauth2_flow | ||
|
||
|
||
class ConfigEntryAuth: |
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.
This isn't used anywhere. The idea with this class is that it should inherit the library client class and help the library to refresh the access token since Home Assistant is in control of it instead of the library.
https://developers.home-assistant.io/docs/api_lib_auth#oauth2
The only time the token is refreshed currently is when the config entry is setup. So the user needs to reload the config entry to refresh the token. This is not how it's supposed to work.
Before every request the client should call async_get_access_token (check_and_refresh_token) to get a valid token.
async def async_turn_on(self, **kwargs: Any) -> None: | ||
"""Turn on the switch.""" | ||
send_command = await self.coordinator.microbees.sendCommand(self.actuator_id, 1) | ||
if send_command: |
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.
Invert the check and raise if true. Then we can outdent below.
"authorize_url_timeout": "[%key:common::config_flow::abort::oauth2_authorize_url_timeout%]", | ||
"no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]", | ||
"user_rejected_authorize": "[%key:common::config_flow::abort::oauth2_user_rejected_authorize%]" | ||
}, |
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're missing strings for abort reasons for invalid_auth, unknown, and wrong_account.
Breaking change
Proposed change
New Custom integration microBees for HomeAssistant
Type of change
Additional information
Checklist
black --fast 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: