Python client for interfacing with the Trinnov Altitude processor
Project description
Trinnov Altitude Python Library
A Python library for interacting with the Trinnov Altitude processor via the TCP/IP automation protocol provided by the Trinnov Altitude.
Overview
The Trinnov Altitude processor is simply a computer that exposes an automation protocol over TCP/IP or RS232 serial link for remote control. This library uses the TCP/IP interface.
The interface is a two-way communication protocol. At any time the processor can broadcast messages to all connected client reflecting processor state changes, and these messages are in no gauranteed order. For example, the user could turn the volume knob on the processor itself which would broad volume change messages to all clients.
Therefore, it's important to architect usage of this library to handle state changes asynchronously. You should not be polling the processor for state changes. Instead, you should receive messages and process them in real-time.
Basic Usage
Connect
from trinnov_altitude.trinnov_altitude import TrinnovAltitude
# Instantiate the Trinnov Altitude client. Adjust the `host` and `client_id`
# accordingly.
altitude = TrinnovAltitude(host = "192.168.1.90", client_id = "my_altitude_integration")
# Connect to the Trinnov Altitude processor
await altitude.connect()
# Shortly after connecting, the processor will send a group of messages
# reflecting the current state. The `sync` method receives _all_ messages
# and updates it's state accordingly.
await altitude.sync()
# See the current volume level
altitude.volume
# Change the processor's volume
await altitude.set_volume(-45)
# Sync again
await altitude.sync()
# See the current volume level which should reflect the new value
altitude.volume
# Disconnect
await altitude.disconnect()
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 trinnov-altitude-0.1.0.tar.gz
.
File metadata
- Download URL: trinnov-altitude-0.1.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddf2abff4bc4a5dcfbc499bc9ef906d210461ab7daa1c621e7bcbe42fe33e770 |
|
MD5 | b6686f415c8e8694762b370b0c3ef245 |
|
BLAKE2b-256 | 1c8d3b41d481759ffe8b31f968a8d783052fdb788f86fd96d9ee2f549fed7244 |
File details
Details for the file trinnov_altitude-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: trinnov_altitude-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83ef33cceec3dbd0bb30a208f345b31412f4496f4b31725862545ee8f8508977 |
|
MD5 | cfe78b23fed42deee7e0003a99dbc6c0 |
|
BLAKE2b-256 | c7fafac2759ddb5d71309ef8f7d75780ae5e451652ed2f47683f5b965cd87ba2 |