Asynchronous python client for Home Assistant Supervisor.
Project description
Home Assistant Supervisor Client
Client Library for Home Assistant Supervisor
Python client for interfacing with the Home Assistant Supervisor via its REST API. Currently used in the Home Assistant Supervisor integration in Home Assistant.
Add-ons which interface with Supervisor can also leverage it. The library expects
to find the access token in the SUPERVISOR_TOKEN
env which is set automatically
by Supervisor for add-ons. Currently there is no way to get a long-lived access
token for Supervisor outside these use cases so the library's usage is limited
to these.
Installation
The library is published on pip
and can be installed that way:
pip install aiohasupervisor
And then used via import
import asyncio
import supervisor_client
asyncio.run(supervisor_client.info())
Output would look like the example response in /info
from here
Developing & contributing
Prerequisites
The client can interact remotely with the Home Assistant Supervisor using the
remote_api
add-on from the developer add-ons repository.
After installing and starting the add-on, a token is shown in the remote_api
add-on log, which is needed for further development.
It is also recommended you use Visual Studio Code for development with the devcontainer extension. This will read the published devcontainer configuration and setup the development environment for you.
Get the source code
Fork (https://github.com/home-assistant-libs/python-supervisor-client/fork) or clone this repository.
Using it in development
From within the devcontainer, open terminal and do the following:
uv pip install -e .
export SUPERVISOR_API_URL=http://192.168.1.2
export SUPERVISOR_TOKEN=replace_this_with_remote_api_token
python examples/connectivity_test.py
Output should match the example response in /info
as shown/linked above in Installation.
Note: Replace the 192.168.1.2
with the IP address of your Home Assistant
instance running the remote_api
add-on and use the token provided.
Contributing a change
- Create a feature branch on your fork/clone of the git repository.
- Commit your changes.
- Rebase your local changes against the
main
branch. - Run test suite with the
pytest tests
command or use Test Explorer and confirm that it passes. - Use
ruff
to format your code with the rules configured in this project - Create a new Pull Request
Release
Any time the API changes for Home Assistant Supervisor a corresponding release should be published here. Once that release is available on pip a PR should be created to Home Assistant Core updating its Home Assistant Supervisor integration. Follow the directions for updating Requirements in the Integration manifest.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aiohasupervisor-0.2.1.tar.gz
.
File metadata
- Download URL: aiohasupervisor-0.2.1.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1242165fd255796c961dadfbb88fc1f0d45f8441f8af10f42899ab478b1cbd9 |
|
MD5 | 5e360eea07ca82c49c410f3fc202ef8b |
|
BLAKE2b-256 | 4bc87eed41d183ae5290761b101651baf688014c4ecf4e398311dd2255a0e6b0 |
Provenance
The following attestation bundles were made for aiohasupervisor-0.2.1.tar.gz
:
Publisher:
release.yaml
on home-assistant-libs/python-supervisor-client
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
aiohasupervisor-0.2.1.tar.gz
- Subject digest:
a1242165fd255796c961dadfbb88fc1f0d45f8441f8af10f42899ab478b1cbd9
- Sigstore transparency entry: 145504971
- Sigstore integration time:
- Permalink:
home-assistant-libs/python-supervisor-client@1c0f4856e00f853a4125f7deed21ce14d8efbbfe
- Branch / Tag:
refs/tags/0.2.1
- Owner: https://github.com/home-assistant-libs
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yaml@1c0f4856e00f853a4125f7deed21ce14d8efbbfe
- Trigger Event:
release
- Statement type:
File details
Details for the file aiohasupervisor-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: aiohasupervisor-0.2.1-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e17c916bc1cec13611f74851305c8901525612ac6261e6aba2b225f2b15016 |
|
MD5 | 82b18eb96f95a6bedd9b83f13a3783d9 |
|
BLAKE2b-256 | 3e483a96f8b3510d82260d0912929ef5337262659688659e1e2e87386deec8e8 |
Provenance
The following attestation bundles were made for aiohasupervisor-0.2.1-py3-none-any.whl
:
Publisher:
release.yaml
on home-assistant-libs/python-supervisor-client
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
aiohasupervisor-0.2.1-py3-none-any.whl
- Subject digest:
b1e17c916bc1cec13611f74851305c8901525612ac6261e6aba2b225f2b15016
- Sigstore transparency entry: 145504973
- Sigstore integration time:
- Permalink:
home-assistant-libs/python-supervisor-client@1c0f4856e00f853a4125f7deed21ce14d8efbbfe
- Branch / Tag:
refs/tags/0.2.1
- Owner: https://github.com/home-assistant-libs
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yaml@1c0f4856e00f853a4125f7deed21ce14d8efbbfe
- Trigger Event:
release
- Statement type: