Python client for interfacing with the Trinnov Altitude processor.
Project description
Trinnov Altitude Python Library
Async Trinnov Altitude client for long-running integrations (Home Assistant primary target).
Version 2.0
Version 2.x is a clean break from 1.x.
- No compatibility shims
- New lifecycle (
start/wait_synced/stop) - New state model (
client.state) - Optional command ACK handling
Read the migration guide: docs/MIGRATION_V2.md
Installation
pip install trinnov-altitude
Quick Start
import asyncio
from trinnov_altitude.client import TrinnovAltitudeClient
async def main() -> None:
client = TrinnovAltitudeClient(host="192.168.1.90")
try:
await client.start()
await client.wait_synced(timeout=10)
await client.volume_set(-30.0)
await client.mute_on()
print(client.state.volume)
print(client.state.source)
finally:
await client.stop()
asyncio.run(main())
Lifecycle
await client.start()connects, bootstraps, and starts the read loop.await client.wait_synced()waits until welcome + catalogs + current indices are observed.await client.stop()stops listener and disconnects cleanly.
Events
def on_event(event, message):
if event == "connected":
...
elif event == "disconnected":
...
elif event == "received_message":
...
client.register_callback(on_event)
Callback exceptions are isolated and logged (they do not crash the listener).
Command ACKs
You can use fire-and-forget commands (default) or explicit ACK waiting:
await client.volume_set(-20.0)
await client.command("volume -20", wait_for_ack=True, ack_timeout=2.0)
Development
uv sync --group dev
uv run ruff check .
uv run ruff format --check .
uv run ty check trinnov_altitude
uv run pytest -v
Or use task wrappers:
task dev
task check
Pyx (optional)
Pyx is optional in this repo. You can keep publishing to PyPI/TestPyPI only.
- Install via Pyx: authenticate
uvwithPYX_API_KEYand configure your Pyx index URL inuv(uv add --index .../uv sync). - Publish to Pyx: run the
Releaseworkflow manually withtarget=pyxafter setting repository secretsPYX_API_KEYandPYX_PUBLISH_URL. - No dual-publish requirement: use Pyx when you need private/internal package distribution or policy control.
Release
- Update version in
trinnov_altitude/__init__.py. - Update
CHANGELOG.md. - Merge to
master(CI runs quality/tests/package checks). - Create a prerelease tag like
vX.Y.Zrc1to publish to TestPyPI. - Create a full release tag like
vX.Y.Zto publish to PyPI. - Ensure release tag matches
__version__(workflow enforces this).
Maintenance
- Migration guide: docs/MIGRATION_V2.md
- Maintainer runbook: docs/MAINTAINERS.md
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 trinnov_altitude-2.0.0.tar.gz.
File metadata
- Download URL: trinnov_altitude-2.0.0.tar.gz
- Upload date:
- Size: 221.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6190629dd35cfe284fab1ad3fcd090c0a938a3d96d09e0923c4a9c90f17772e3
|
|
| MD5 |
5254d2d7e97ccb2e48300f48b79ee794
|
|
| BLAKE2b-256 |
bee7829d64f23e231577e4e9635faf01b73a21076f5796106231dda78ed7e3c7
|
Provenance
The following attestation bundles were made for trinnov_altitude-2.0.0.tar.gz:
Publisher:
publish.yml on binarylogic/py-trinnov-altitude
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinnov_altitude-2.0.0.tar.gz -
Subject digest:
6190629dd35cfe284fab1ad3fcd090c0a938a3d96d09e0923c4a9c90f17772e3 - Sigstore transparency entry: 1002908493
- Sigstore integration time:
-
Permalink:
binarylogic/py-trinnov-altitude@6d1016f07e6f41c1a61999fb00047787b2f97053 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/binarylogic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d1016f07e6f41c1a61999fb00047787b2f97053 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file trinnov_altitude-2.0.0-py3-none-any.whl.
File metadata
- Download URL: trinnov_altitude-2.0.0-py3-none-any.whl
- Upload date:
- Size: 17.0 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 |
79e3f220a73f993702227ef96e20fea47b60384161261d1894bf3dffd4ea4d4e
|
|
| MD5 |
7b56554c46a608dbeaefa24445b45e92
|
|
| BLAKE2b-256 |
89d48c6046867ecfaefe952fe6e0d6e621c0eee8c12494ac68765be30628e693
|
Provenance
The following attestation bundles were made for trinnov_altitude-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on binarylogic/py-trinnov-altitude
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinnov_altitude-2.0.0-py3-none-any.whl -
Subject digest:
79e3f220a73f993702227ef96e20fea47b60384161261d1894bf3dffd4ea4d4e - Sigstore transparency entry: 1002908498
- Sigstore integration time:
-
Permalink:
binarylogic/py-trinnov-altitude@6d1016f07e6f41c1a61999fb00047787b2f97053 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/binarylogic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d1016f07e6f41c1a61999fb00047787b2f97053 -
Trigger Event:
workflow_dispatch
-
Statement type: