Asynchronous Python client for HDFury devices
Project description
HDFury API Client
An asynchronous Python client for communicating with HDFury devices via their HTTP API. This lightweight library provides methods for fetching device information, configuration, and issuing control commands such as reboot, hotplug, and mode changes.
Features
- Asynchronous communication using
aiohttp - Fetch device information and configuration
- Issue control commands (reboot, hotplug, relay, mute, etc.)
- Built-in error handling for connection and parsing failures
- Designed for easy integration into automation tools or async workflows
Requirements
- Python 3.11+
aiohttplibrary
Usage Example
import asyncio
from hdfury import HDFuryAPI, HDFuryError
async def main():
client = HDFuryAPI("192.168.1.100") # Replace with your device IP
try:
info = await client.get_info()
print("Device Info:", info)
board = await client.get_board()
print("Board Info:", board)
config = await client.get_config()
print("Configuration:", config)
# Example command: reboot the device
await client.issue_reboot()
print("Reboot command sent!")
except HDFuryError as err:
print(f"Error communicating with HDFury device: {err}")
finally:
await client.close()
asyncio.run(main())
API Reference
Class: HDFuryAPI
Initialization
HDFuryAPI(host: str, session: aiohttp.ClientSession | None = None)
- host – IP address or hostname of the HDFury device.
- session (optional) – existing
aiohttp.ClientSessionto reuse.
Fetch Methods
| Method | Description |
|---|---|
get_board() |
Get board information (/ssi/brdinfo.ssi) |
get_info() |
Get general device info (/ssi/infopage.ssi) |
get_config() |
Get configuration data (/ssi/confpage.ssi) and CEC data (if provided) (/ssi/cecpage.ssi) |
Command Methods
| Method | Description |
|---|---|
issue_reboot() |
Reboot the device |
issue_hotplug() |
Trigger HDMI hotplug |
set_operation_mode(mode) |
Set device operation mode |
set_port_selection(tx0, tx1) |
Set device HDMI port selection |
set_auto_switch_inputs(state) |
Toggle auto input switching |
set_htpc_mode_rx0(state) → set_htpc_mode_rx3(state) |
Set HTPC mode per input |
set_mute_tx0_audio(state) → set_mute_tx1_audio(state) |
Mute/unmute TX audio |
set_oled(state) |
Control OLED display |
set_ir_active(state) |
Enable/disable IR |
set_relay(state) |
Control relay state |
set_cec_rx0(state) → set_cec_rx3(state) |
Enable/disable CEC per input |
Cleanup
await client.close()
Closes any open HTTP sessions.
Exception Handling
All exceptions inherit from HDFuryError.
| Exception | Description |
|---|---|
HDFuryError |
Base exception for the HDFury client |
HDFuryConnectionError |
Connection-related errors (timeouts, bad responses, etc.) |
HDFuryParseError |
Raised when JSON decoding fails |
Constants
OPERATION_MODES
Defined in const.py, this dictionary maps known operation mode identifiers to their human-readable descriptions.
from hdfury import OPERATION_MODES
for mode, description in OPERATION_MODES.items():
print(f"{mode}: {description}")
| Key | Description |
|---|---|
"0" |
Mode 0 - Splitter TX0/TX1 FRL5 VRR |
"1" |
Mode 1 - Splitter TX0/TX1 UPSCALE FRL5 |
"2" |
Mode 2 - Matrix TMDS |
"3" |
Mode 3 - Matrix FRL→TMDS |
"4" |
Mode 4 - Matrix DOWNSCALE |
"5" |
Mode 5 - Matrix RX0:FRL5 + RX1-3:TMDS |
These can be used to display or interpret the current operating mode returned by the device.
TX0_INPUT_PORTS
Maps available TX0 input port IDs to human-readable labels.
from hdfury import TX0_INPUT_PORTS
print(TX0_INPUT_PORTS["1"]) # Output: Input 1
| Key | Description |
|---|---|
"0" |
Input 0 |
"1" |
Input 1 |
"2" |
Input 2 |
"3" |
Input 3 |
"4" |
Copy TX0 |
TX1_INPUT_PORTS
Maps available TX1 input port IDs to human-readable labels.
from hdfury import TX1_INPUT_PORTS
print(TX1_INPUT_PORTS["3"]) # Output: Input 3
| Key | Description |
|---|---|
"0" |
Input 0 |
"1" |
Input 1 |
"2" |
Input 2 |
"3" |
Input 3 |
"4" |
Copy TX1 |
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hdfury-1.4.0.tar.gz.
File metadata
- Download URL: hdfury-1.4.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e115b29a70753f4eb7ebcbb24b9c26f9a2ce8fc6d07c907f1657543cd1c25b8
|
|
| MD5 |
4ea9a7bb0d96c5da5634965893789ccd
|
|
| BLAKE2b-256 |
424db042c0d4b190ffc7d32aef68d8ef403b594633c1116f1f98eb83687ba923
|
Provenance
The following attestation bundles were made for hdfury-1.4.0.tar.gz:
Publisher:
publish.yml on glenndehaan/python-hdfury
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hdfury-1.4.0.tar.gz -
Subject digest:
7e115b29a70753f4eb7ebcbb24b9c26f9a2ce8fc6d07c907f1657543cd1c25b8 - Sigstore transparency entry: 832834928
- Sigstore integration time:
-
Permalink:
glenndehaan/python-hdfury@0930c545ede97f82a75f5cbcde3fb6f615cd8e33 -
Branch / Tag:
refs/tags/1.4.0 - Owner: https://github.com/glenndehaan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0930c545ede97f82a75f5cbcde3fb6f615cd8e33 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hdfury-1.4.0-py3-none-any.whl.
File metadata
- Download URL: hdfury-1.4.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
370502c0cfc2e0c12ffa561dc8ed88e134df019d489d1fe363c5005343b3d3f2
|
|
| MD5 |
c399ef1d8afa1e40d0c2d8812c13ec17
|
|
| BLAKE2b-256 |
538e8efe04e7a9d6f6c4b7291f63b9b4cc7ef4253a5e9ef338a1f6ede21e1209
|
Provenance
The following attestation bundles were made for hdfury-1.4.0-py3-none-any.whl:
Publisher:
publish.yml on glenndehaan/python-hdfury
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hdfury-1.4.0-py3-none-any.whl -
Subject digest:
370502c0cfc2e0c12ffa561dc8ed88e134df019d489d1fe363c5005343b3d3f2 - Sigstore transparency entry: 832834932
- Sigstore integration time:
-
Permalink:
glenndehaan/python-hdfury@0930c545ede97f82a75f5cbcde3fb6f615cd8e33 -
Branch / Tag:
refs/tags/1.4.0 - Owner: https://github.com/glenndehaan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0930c545ede97f82a75f5cbcde3fb6f615cd8e33 -
Trigger Event:
release
-
Statement type: