Async Python client for the Homecast API
Project description
pyhomecast
Async Python client for the Homecast REST API.
Installation
pip install pyhomecast
Usage
import aiohttp
from pyhomecast import HomecastClient
async with aiohttp.ClientSession() as session:
client = HomecastClient(session)
client.authenticate("your_access_token")
# Get all device state
state = await client.get_state()
for device in state.devices.values():
print(f"{device.name} ({device.device_type}): {device.state}")
# Control a device
await client.set_state({
"my_home_0bf8": {
"living_room_a1b2": {
"ceiling_light_c3d4": {"on": True, "brightness": 80}
}
}
})
# Run a scene
await client.run_scene("my_home_0bf8", "Good Morning")
API
HomecastClient(session, api_url="https://api.homecast.cloud")
authenticate(token)- Set the Bearer tokenget_state(home?, room?, device_type?, name?)- Fetch device state (returnsHomecastState)set_state(updates)- Control devicesrun_scene(home, name)- Execute a scene
Models
HomecastState- ContainsdevicesandhomesdictsHomecastDevice- Single device withstate,settable,device_typeHomecastHome- Home withkeyandname
Exceptions
HomecastError- Base exceptionHomecastAuthError- 401/403 errorsHomecastConnectionError- Network/server errors
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyhomecast-0.3.0.tar.gz.
File metadata
- Download URL: pyhomecast-0.3.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
619e593983af0c58ffd88d9193e4e8f199759726b5a68cb463f34e9a68758eb7
|
|
| MD5 |
3a5817ed75f1f20e34ef184ac4500327
|
|
| BLAKE2b-256 |
6927540e3ad985cfc7048298bef0152bb40cd7f6fa2b550c76dade535a389923
|
Provenance
The following attestation bundles were made for pyhomecast-0.3.0.tar.gz:
Publisher:
python-package.yml on parob/pyhomecast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhomecast-0.3.0.tar.gz -
Subject digest:
619e593983af0c58ffd88d9193e4e8f199759726b5a68cb463f34e9a68758eb7 - Sigstore transparency entry: 1239245259
- Sigstore integration time:
-
Permalink:
parob/pyhomecast@74148d75c0e1f723991b1cc7f8a470888e628c28 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/parob
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@74148d75c0e1f723991b1cc7f8a470888e628c28 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyhomecast-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pyhomecast-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fa49cbd54ff475495f65d6d07a2df5c0906d036d0343459355f241985fa5b95
|
|
| MD5 |
4f6cac1256501414a507555393ce3fae
|
|
| BLAKE2b-256 |
50b44646069a59f88257591c8dfb852d581eefc7b1c5d616bfe6563c1fa9121e
|
Provenance
The following attestation bundles were made for pyhomecast-0.3.0-py3-none-any.whl:
Publisher:
python-package.yml on parob/pyhomecast
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyhomecast-0.3.0-py3-none-any.whl -
Subject digest:
8fa49cbd54ff475495f65d6d07a2df5c0906d036d0343459355f241985fa5b95 - Sigstore transparency entry: 1239245260
- Sigstore integration time:
-
Permalink:
parob/pyhomecast@74148d75c0e1f723991b1cc7f8a470888e628c28 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/parob
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@74148d75c0e1f723991b1cc7f8a470888e628c28 -
Trigger Event:
push
-
Statement type: