core icon indicating copy to clipboard operation
core copied to clipboard

WIP: Add Awair Local API support

Open zachberger opened this issue 3 years ago • 2 comments

Proposed change

Add support for Awair's (beta) Local API. This API supports more frequent polling and will work when there is no Internet connection.

Previous attempt in #39538 but that was introducing an entirely new integration. #39538#issuecomment-693547702 suggested extending the current awair component to add an option for the local API, which this new PR does. #39538 also suggested mDNS discovery, that is not in this PR, but could be explored and submitted in a future PR.

Although it is "working", this PR is not complete. I'm opening it to seek feedback from @ahayworth and other current maintainers of the integration before going much further.

Still to be done:

  • [ ] Tests need to be written
  • [ ] documentation needs to be updated
  • [x] more thoughtful unique IDs for local API
  • [x] more thoughtful strings for ConfigFlow

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: N/A
  • This PR is related to issue: #39538
  • Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/23588

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)
  • [ ] Tests have been added to verify that the new code works. TODO

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.
  • [ ] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [ ] Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • [ ] No score or internal
  • [ ] 🥈 Silver
  • [ ] 🥇 Gold
  • [ ] 🏆 Platinum

To help with the load of incoming pull requests:

zachberger avatar Jul 20 '22 22:07 zachberger

Hey there @ahayworth, @danielsjf, mind taking a look at this pull request as it has been labeled with an integration (awair) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Slowly making some progress on this. Its summer so not too much free time.

  • I was able to get discover working fairly simply in 5d4efb2
  • Started working on documentation in https://github.com/home-assistant/home-assistant.io/pull/23588

zachberger avatar Jul 31 '22 03:07 zachberger

I have more tests to add before this is done, but @ahayworth could you PTAL too, I'd appreciate your feedback on the state of the integration.

zachberger avatar Aug 10 '22 17:08 zachberger

Great contribution, thanks! 🎉

balloob avatar Aug 11 '22 13:08 balloob

@zachberger I think it's lovely. 😄 If you want to help maintain this component ... that's lovely too 😉 I don't have as much time for open source right now as I would like, and I don't want to be a blocker for further improvements!

ahayworth avatar Aug 11 '22 13:08 ahayworth

Thanks everyone for the help getting this across the line!

zachberger avatar Aug 11 '22 17:08 zachberger