HyperHDR Ambient Lighting Python Package
Project description
hyperhdr-py
A Python library for controlling HyperHDR ambient lighting systems.
This library builds on Dermot Duffy’s hyperion-py.
Features
- Full async support with
asyncio - Connect to the HyperHDR JSON API
- Control colors, effects, components, and more
- Subscribe to real-time state updates
- Support for HyperHDR v19 through v22+
- Optional WebSocket LED color/gradient streaming (requires
aiohttp)
New in v0.1.0 (HyperHDR v20–v22)
- Average color — Average color of current LED output
- Smoothing control — Adjust smoothing, including v22 interpolators
- HDR tone mapping — Tone mapping mode and automatic detection (v21+)
- Service discovery — Discover HyperHDR instances on the network
- Current LED colors — Read colors being sent to LEDs
- Performance benchmarking — Run server benchmarks
- Config management — Save/load the configuration database
Installation
pip install hyperhdr-py-sickkick
Quick start
import asyncio
from hyperhdr import client, const
async def main():
async with client.HyperHDRClient("hyperhdr.local") as hc:
if hc:
adjustment = hc.adjustment
if adjustment:
print(f"Brightness: {adjustment[0][const.KEY_BRIGHTNESS]}%")
await hc.async_set_color(color=[255, 0, 0], priority=50)
await hc.async_set_effect(effect={"name": "Rainbow swirl"}, priority=50)
asyncio.run(main())
LED streaming (WebSocket)
Install dependencies before using the stream helpers:
pip install aiohttp
If you use convert_to_jpeg=True, install Pillow as well, or use the extras:
pip install "hyperhdr-py-sickkick[stream]"
pip install "hyperhdr-py-sickkick[stream-jpeg]"
import asyncio
from hyperhdr.stream import HyperHDRLedColorsStream, HyperHDRLedGradientStream
async def main():
led_colors = HyperHDRLedColorsStream("hyperhdr.local", token="YOUR_TOKEN")
await led_colors.start()
frame = await led_colors.wait_for_frame()
if frame and frame.raw:
print("LED bytes:", len(frame.raw))
await led_colors.stop()
led_gradient = HyperHDRLedGradientStream("hyperhdr.local")
async for frame in led_gradient.frames():
print("Gradient update:", frame.source)
break
await led_gradient.stop()
asyncio.run(main())
See examples/stream_leds.py for a runnable script.
API and data model
Request and response shapes follow the HyperHDR JSON API. Async methods on HyperHDRClient are named async_* and match that API; see hyperhdr/client.py for the full list.
For threaded use without asyncio, use ThreadedHyperHDRClient (same method names without the async_ prefix). After start(), call wait_for_client_init() before connecting.
Credits
Thanks to Dermot Duffy for hyperion-py, which this project extends.
Feel free to open an issue if you run into problems.
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 hyperhdr_py_sickkick-0.2.1.tar.gz.
File metadata
- Download URL: hyperhdr_py_sickkick-0.2.1.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ec927360544d5ed9aa7325d02496dd2302c72e29a9745bb71e93469ec03d1fb
|
|
| MD5 |
24d4659eeb49837aaad0207b40ddfae4
|
|
| BLAKE2b-256 |
3c06119d4826782733b5c72636777b06be1ffe0875193dac99edb7e84177be4c
|
File details
Details for the file hyperhdr_py_sickkick-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hyperhdr_py_sickkick-0.2.1-py3-none-any.whl
- Upload date:
- Size: 28.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3293cc90b9521c72ec6bcc1320e5afa528b3d74071602529a0cd10fb0159868d
|
|
| MD5 |
1dacd6e7a428008075fd126581b96499
|
|
| BLAKE2b-256 |
2206e699353724832154d201f44fd45fe78e42f0931169632bcce123f16cc0d6
|