Skip to main content

Package for controlling HDFury VRROOM HDMI switches via Python.

Project description

VRROOMpy

Overview

VRROOMpy is a pure Python package for controlling HDFury VRROOM HDMI switches.

Only a subset of the full VRROOM API is currently available, but development on the remaining commands is ongoing.

The eventual intent is for this package to be used in a Home Assistant integration, which is hopefully coming soon.

Usage

VRROOMpy provides two different APIs: "Raw" and "Command".

Regardless of the API, Python's socket package and class are used to establish the network connection. The APIs then call upon that socket to control the switch.

Raw API

Calling the API directly via strings is exposed via the Codec class. The command names themselves can be found in the accompanying documentation file from HDFury.

For example, the following code snippet gets the current value, then overwrites the input TX0:

import socket
from vrroompy.codec import Codec

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as vrroom_socket:
    vrroom_socket.connect((address, port))

    vrroom_socket.sendall(Codec.encode_command_raw("get inseltx0"))
    print(vrroom_socket.recv(256))  # Prints "inseltx0 1"

    vrroom_socket.sendall(Codec.encode_command_raw("set inseltx0 2"))
    print(vrroom_socket.recv(256))  # Prints "inseltx0 2"

Command API

The command API provides a higher-level, more Pythonic interface to the VRROOM switch. Commands are distributed by function within the commands sub-package.

For example, the following code snippet performs the same get/set of the TXO input:

import socket
from vrroompy.commands.input import Input, get_selected_input_tx0, set_selected_input_tx0

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as vrroom_socket:
    vrroom_socket.connect((address, port))

    print(get_selected_input_tx0(vrroom_socket))  # Prints "1" (Input.RX1)
    set_selected_input_tx0(vrroom_socket, Input.RX2)
    print(get_selected_input_tx0(vrroom_socket))  # Prints "2" (Input.RX2)

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

VRROOMpy-1.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

VRROOMpy-1.1.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file VRROOMpy-1.1.0.tar.gz.

File metadata

  • Download URL: VRROOMpy-1.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for VRROOMpy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 57fe7b13aa73923436bbee87386c1115733bdfd7285c446b733e59f557fad4f9
MD5 7eb1bbab98879f6014d400470fa9cb90
BLAKE2b-256 9d35143bee33072c9b0668972003c3791db62fdbdae408d41899538f544ff782

See more details on using hashes here.

File details

Details for the file VRROOMpy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: VRROOMpy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for VRROOMpy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a37aeebe5627d82d931894cf93277e2a52719065d12a9a37ccd21e8800f36709
MD5 9fd9f6493feb4028e5005f14c6889167
BLAKE2b-256 2b4e27299d330adc20106df2182b45c162ef7671a0b7479a13e09f81a68844b0

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