Skip to main content

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+
  • aiohttp library

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.ClientSession to 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)

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

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

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

hdfury-1.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

hdfury-1.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file hdfury-1.1.1.tar.gz.

File metadata

  • Download URL: hdfury-1.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hdfury-1.1.1.tar.gz
Algorithm Hash digest
SHA256 3bf00423c03f435048ba9b1d7ea6902e994fb28349af10f12c38e8dcd0df944e
MD5 edcaff301d6cb22bbbc37ec42c83318e
BLAKE2b-256 f3b5c4f51e342b583836f9eb67db4db2b7c9b940970168ab33f11f7d01fb429e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdfury-1.1.1.tar.gz:

Publisher: publish.yml on glenndehaan/python-hdfury

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hdfury-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: hdfury-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hdfury-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db9f97c100333dc3978efd267d4c2a3d18af8ecd1701d481c4cf36a223291e38
MD5 70ebd5a2ada15893fa397017818b48ac
BLAKE2b-256 b977e6580f51187bc7a21f6e7ebfadc8e8f26ef929688957dc07df12a19cc977

See more details on using hashes here.

Provenance

The following attestation bundles were made for hdfury-1.1.1-py3-none-any.whl:

Publisher: publish.yml on glenndehaan/python-hdfury

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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