core icon indicating copy to clipboard operation
core copied to clipboard

Use aiohasupervisor for addon info calls

Open mdegat01 opened this issue 1 year ago • 2 comments

Proposed change

Begin the process of replacing hassio/handler with a published client library on pip in aiohasupervisor. As this is our guidance to all other integration developers, our supervisor integration should follow this as well.

Since the hassio component's internal library is used all over integrations for access to supervisor information replacing handler will likely take a good number of PRs. This PR seeks only to replace the method used for obtaining addon info with the equivalent method from the library.

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [ ] 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)
  • [x] 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

  • [ ] The code change is tested and works locally.
  • [ ] Local tests pass. Your PR cannot be merged unless tests pass
  • [ ] There is no commented out code in this PR.
  • [ ] I have followed the development checklist
  • [ ] I have followed the perfect PR recommendations
  • [ ] The code has been formatted using Ruff (ruff format homeassistant tests)
  • [ ] 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:

  • [ ] 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.

To help with the load of incoming pull requests:

mdegat01 avatar Sep 13 '24 20:09 mdegat01

Not sure how the errors in the hassio/issues tests didn't show up when I was running them locally but I'll fix those. The bluetooth ones I'm seeing the same failures when I switch to dev branch locally so I don't think those are a result of this PR? Will circle back.

mdegat01 avatar Sep 13 '24 21:09 mdegat01

I'm going to call this ready for review. Yes there is a failure in a test in the Plugwise integration but the test appears to be flaky. I ran it locally against dev branch and it failed 2 times in 10 with no changes in between. I opened #126086 for it.

mdegat01 avatar Sep 16 '24 21:09 mdegat01

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 Sep 17 '24 14:09 home-assistant[bot]

Hi, I just did a fresh installation of HA core from dev using script/setup and got a missing import error for aiohasupervisor. I think this PR is the cause although I'm not clear why a core install loads hassio as I thought that was the supervisor.

To reproduce

sdb9696 avatar Sep 19 '24 12:09 sdb9696

We're aware and a solution is under way.

MartinHjelmare avatar Sep 19 '24 12:09 MartinHjelmare

The missing import problem should be solved by: https://github.com/home-assistant/core/pull/126225

MartinHjelmare avatar Sep 19 '24 13:09 MartinHjelmare