-
-
Notifications
You must be signed in to change notification settings - Fork 32.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 basic support for HomeWizard v2 API configuration flow #135414
Add basic support for HomeWizard v2 API configuration flow #135414
Conversation
9681078
to
d9b37a9
Compare
daf66e3
to
549b3fc
Compare
tests/components/homewizard/fixtures/v2/generic/post_user_403_forbidden.json
Outdated
Show resolved
Hide resolved
tests/components/homewizard/fixtures/v2/generic/post_user_401_unauthorized.json
Outdated
Show resolved
Hide resolved
tests/components/homewizard/fixtures/v2/generic/post_user_400_bad_request.json
Outdated
Show resolved
Hide resolved
@@ -65,6 +72,59 @@ def mock_homewizardenergy( | |||
yield client | |||
|
|||
|
|||
@pytest.fixture | |||
def mock_homewizardenergy_v2( |
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 feels dirty, if you have ideas/examples how to improve this let me know!
…d-user-v2-support
# Tell device we want a token, user must now press the button within 30 seconds | ||
with contextlib.suppress(DisabledError): | ||
token = await api.get_token("home-assistant") |
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.
More information about this flow can be found here: https://api-documentation.homewizard.com/docs/v2/authorization#create-user-and-get-token
@joostlek, I think I’ve processed all the feedback and got the docs ready. Do you mind to take a look at this one again? |
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, @DCSBL 👍
../Frenck
13835b7
into
home-assistant:intermediate-homewizard-v2-api
Proposed change
This API allows the user to configure the device via the v2 API. This API is now using a authorization step similar to Hue, where the user has to proof the possession by pressing the button on the device. Therefore the config flow has to be adjusted.
To keep this PR a bit concise, I didn't implement reauthorization, extensive error handling and migration. This will be done in follow-up PR's if that is okay.
You can test this with real hardware, ask me via a DM on discord for instructions.
Waits for #135315Waits for #135778Next steps:
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: