core
core copied to clipboard
Add config flow to Hydrawise
Proposed change
This adds a config flow to the Hydrawise component and begins migrating away from YAML configuration.
The config flow uses a new API for communicating with Hydrawise. This API uses a different authentication mechanism (username/password combo instead of an access token) and has much more robust capabilities (it isn't heavily rate-limited, more data is available, string values aren't truncated, etc).
For this initial commit, only the switch platform is supported. It sets up two devices with switches:
- A device for the controller, which has a switch to start/stop all irrigation zones.
- A device for each irrigation zone attached to the controller, each having a switch to start/stop that particular irrigation zone.
The legacy YAML-based configuration remains supported for now, since not all features have been ported. Subsequent PRs will continue to port over functionality from the legacy implementation. I was going to defer updating documentation until I was done, but if you'd like I'm happy to update with what's been migrated in this PR. :-)
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] There is no commented out code in this PR.
- [x] I have followed the development checklist
- [x] The code has been formatted using Black (
black --fast homeassistant tests) - [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for www.home-assistant.io
If the code communicates with devices, web services, or third-party tools:
- [x] The manifest file has all fields filled out correctly.
Updated and included derived files by running:python3 -m script.hassfest. - [x] New or updated dependencies have been added to
requirements_all.txt.
Updated by runningpython3 -m script.gen_requirements_all. - [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [x] Untested files have been added to
.coveragerc.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other open pull requests in this repository.
Hi dknowles2
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!
Hey there @ptcryan, mind taking a look at this pull request as it has been labeled with an integration (hydrawise) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of hydrawise can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleChange the title of the issue.@home-assistant reopenReopen the issue.@home-assistant unassign hydrawiseRemoves the current integration label and assignees on the issue, add the integration domain after the command.
Ping? Is anyone able to review this?
Ping?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
I can confirm that the actual "hydrawiser" lib is not up to date and half of the sensors are not working anymore. Also there is no support any more from the dev. Hunterr already changed the restapi a few times.
So I really suggest to moving to the new pydrawiser lib.