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.0.0.tar.gz (18.1 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.0.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for VRROOMpy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 12a15fb7a51c572533791b12544b3a423161ca4175aaa480152d4b6fc9a9b87d
MD5 e206075119560ab537f646f80323a125
BLAKE2b-256 0e02f011a1500d7bfe8b566fb7f4ab15052c06641ce8e593a89dd5cf641e1af7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: VRROOMpy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 137fbc3ee46ad9a78bdd63fadfde1173630c5a878a8948c1e6153a0aa07ed2b3
MD5 9b9bc98035e485edb6c16f38367c3b47
BLAKE2b-256 ee6849599dd0ee7a0359bd503e2581fe02c78d66cf41236028884702feee88c9

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