"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 an audio/video processor that exposes an automation protocol over TCP/IP for remote control.
The interface is a two-way communication protocol. At any time the processor can broadcast messages to all connected clients reflecting the current processor state. For example, the user could turn the volume knob on the processor itself, which would broadcase volume change messages to all connected 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 register a callback that fires when changes are received.
Installation
pip install trinnov-altitude
Setup
Power on
Powers the processor on via Wake on Lan. The process must be powered on before you can connect.
from trinnov_altitude.trinnov_altitude import TrinnovAltitude
altitude = TrinnovAltitude(host = "192.168.1.90", mac = "c8:7f:54:2d:ce:f2")
await altitude.power_on()
Connect
Connect to the processor via TCP/IP. Note that you must power on the device before connecting. The Trinnov Altitude does not have a standby mode that will accept connections.
from trinnov_altitude.trinnov_altitude import TrinnovAltitude
altitude = TrinnovAltitude(host = "192.168.1.90")
try:
await altitude.connect()
finally:
# Always disconnect and cleanup
await altitude.disconnect()
Listen for updates
The processor will broadcast state changes to all connected clients. You must explicitly start listening to receive the messages and sync the internal state of your object.
from trinnov_altitude.trinnov_altitude import TrinnovAltitude
altitude = TrinnovAltitude(host = "192.168.1.90")
# Optionally define a callback to be fired on each individual update
def callback(message):
# react to the change here
pass
# Start listening for updates in an async.io Task
altitude.start_listening(callback: callback)
Commands
All commands assume you have setup your Trinnov Altitude client.
Change the volume
# Get the current volume level
altitude.volume
# Change the processor's volume
await altitude.set_volume(-45)
# See the new volume level. Once sent, the processor
altitude.volume
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.7.tar.gz
.
File metadata
- Download URL: trinnov-altitude-0.1.7.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0f4a643e527aa7c8de00c63af12836324739e44b6ef21a26de5b14728ddd2d2 |
|
MD5 | 850d28d56e011325ab1ac33429c8f80f |
|
BLAKE2b-256 | 6f4209f54ac0884fceb2919fade6d2d061223bc576dbee40d2202857be632558 |
File details
Details for the file trinnov_altitude-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: trinnov_altitude-0.1.7-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b21f5327c98a644a6299b3039306a2ae823af64188f2d22b8170e915fe80a0c |
|
MD5 | 3fb750aed2327f657360521dafd35ef7 |
|
BLAKE2b-256 | ac1cc401372c4ad1b5419ad7e802cc33fafcaa140c9695562a4d15969c3461a8 |