core icon indicating copy to clipboard operation
core copied to clipboard

Add config flow to Hydrawise

Open dknowles2 opened this issue 2 years ago • 5 comments

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:

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 running python3 -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:

dknowles2 avatar Jan 06 '23 14:01 dknowles2

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!

home-assistant[bot] avatar Jan 06 '23 14:01 home-assistant[bot]

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 close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign hydrawise Removes the current integration label and assignees on the issue, add the integration domain after the command.

home-assistant[bot] avatar Jan 06 '23 14:01 home-assistant[bot]

Ping? Is anyone able to review this?

dknowles2 avatar Jan 29 '23 03:01 dknowles2

Ping?

dknowles2 avatar Feb 17 '23 01:02 dknowles2

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar Mar 23 '23 08:03 home-assistant[bot]

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.

smoki3 avatar May 10 '23 13:05 smoki3