Repository navigation
Conversation
New class to wrap the auth for python-hilo
Collaborator
Author
|
CI failure is normal, python-hilo isn't released. |
HiloAuth implements the AbstractAuth interface, which first ships in python-hilo 2026.10.2. With the old pin, CI installed 2026.10.1 and every test failed at import time while loading conftest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
python-hilo used to import Home Assistant directly so it could take an
OAuth2Session. A library depending on its host framework fails thedependency-transparencyrule of the Integration Quality Scale, and it ties python-hilo releases to HA internals.python-hilo now defines an
AbstractAuthinterface instead (dvd-dev/python-hilo#460). The library only asks for a valid access token. The integration decides how to get one.What changed
custom_components/hilo/api.py: newHiloAuthclass. It implementsAbstractAuthby wrapping HA'sOAuth2Session: it callsasync_ensure_token_valid()and then returns the current access token. Token refresh therefore stays with HA's OAuth2 helper, as it did before.__init__.py:APIgetsauth=HiloAuth(...)instead ofoauth_session=....quality_scale.yaml:dependency-transparencyis now markeddone.tests/test_api.py: checks that the token is refreshed before it is returned.Dependency
This needs a python-hilo release that includes
AbstractAuth. The latest tag,2026.10.1, doesn't have it. Before merging,manifest.jsonandpyproject.tomlboth need to be bumped to the same new version.Testing
uv run pytestscripts/develop) with the editable python-hilo install: setup works and tokens still refresh.🤖 Generated with Claude Code