Skip to main content

Python HDMI Matrix control library for AVGear and possibly other HDMI matrix controllers

Project description

AVGear HDMI Matrix Python Library

Python library to control AVGear HDMI Matrix switches (tested with TMX44PRO AVK, may work with others). Both synchronous and asynchronous APIs are provided. Contributions for other models are welcome!

This is used for the AVGear Matrix integration for homeassistant.

Inspired by pyblackbird.

Features

  • TCP/IP control: Communicate with the matrix over the network
  • Sync & Async APIs: Use either blocking or asyncio-based methods
  • Device info: Query device name, type, version, and status
  • Routing control: Route HDMI inputs to outputs programmatically
  • Video status parsing: Parse and display current input/output routing
  • Context manager support: Use with with or async with for auto-connect/disconnect
  • Logging: Built-in debug/info/error logging

Installation

Clone the repo and install dependencies (if any):

git clone https://github.com/marklynch/hdmimatrix.git
cd hdmimatrix
# Optionally: pip install .

Usage

Synchronous Example

from hdmimatrix import HDMIMatrix

matrix = HDMIMatrix("192.168.0.178", 4001)
with matrix:
    print(matrix.get_device_name())
    print(matrix.get_device_status())
    matrix.route_input_to_output(1, 1)

Asynchronous Example

import asyncio
from hdmimatrix import AsyncHDMIMatrix

async def main():
    matrix = AsyncHDMIMatrix("192.168.0.178", 4001)
    async with matrix:
        print(await matrix.get_device_name())
        print(await matrix.get_device_status())
        await matrix.route_input_to_output(1, 1)

asyncio.run(main())

Video Status Parsing

with matrix:
    routing = matrix.get_video_status_parsed()
    print(routing)  # {output_number: input_number}

API Overview

  • HDMIMatrix (sync) and AsyncHDMIMatrix (async) classes
  • Connection:
    • connect()
    • disconnect()
    • Context manager support (with / async with)
  • Info:
    • get_device_name()
    • get_device_status()
    • get_device_type()
    • get_device_version()
    • get_video_status()
    • get_video_status_parsed()
    • get_hdbt_power_status()
    • get_input_status()
    • get_output_status()
    • get_hdcp_status()
    • get_downscaling_status()
  • Control:
    • power_on()
    • power_off()
    • route_input_to_output(input, output)
    • output_on(output)
    • output_off(output)

Contributing

Pull requests for new features, bug fixes, and support for other AVGear models are welcome!

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hdmimatrix-0.0.6.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hdmimatrix-0.0.6-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file hdmimatrix-0.0.6.tar.gz.

File metadata

  • Download URL: hdmimatrix-0.0.6.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for hdmimatrix-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d89fb972f0d2dbeee3ec9a42db52aa47484bd88efa4e2ddfc907a73ae3bb5ce4
MD5 32b3e990a005c22b0ea5f72275873a3e
BLAKE2b-256 8a5138911ec6a5a0bb0638014872b0e4b96ebab3df25eadfd37d76358a783fc0

See more details on using hashes here.

File details

Details for the file hdmimatrix-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: hdmimatrix-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for hdmimatrix-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0ec35744606bcc1dc1689429fe64956b8ef60e5cbd44cb41709e70ea17e2194d
MD5 d0b5182eb4e0b8077a317a18dc0c9cf3
BLAKE2b-256 f0273831a62af324682d19c4efd0204d86508fcdfc68c9f5beb57522128d5fc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page