Skip to main content

Onyx Client

Buy Me A Coffee

This repository contains a Python HTTP client for Hella' s ONYX.CENTER API.


API Versions

It is encouraged to always update Hella devices to the latest software. This will, mostly, also enforce using the newest API. In below table you can find an indication of what Hella API version is supported.

Hella API Version Client Version
v3 >= 3.1.0
v2 >= 2.5.0 < 3.0.0

Installation

The package is published in PyPi and can be installed via:

pip install onyx-client

Configuration

The configuration defines connection properties as a dict for the application running.

Attention: make sure to read the Onyx API Access Control description to retrieve the fingerprint and access token!

Option Description
fingerprint The fingerprint of the ONYX.CENTER.
access_token The permanent access token.
local_address The local address to use (default: None).
client_session The initialized aiohttp.ClientSession. (Default: None, create new session.)

Local Access

The local address can be used to access the ONYX.CENTER API from within the local network. If set, the client will use this address for all API requests.

Access Control Helper

The method onyx_client.authorizer.exchange_code takes the API code and an optional local API address, and performs the exchange to a fingerprint and access token. Please follow the aforementioned documentation to retrieve the code.

Usage

Initalization

You can instantiate the client using the onyx_client.client.create method like:

import aiohttp
from onyx_client.client import create
from onyx_client.authorizer import exchange_code

# by providing the fingerprint and access token only
client = create(fingerprint="fingerprint", access_token="access_token")

# by providing the fingerprint, access token and aiohttp client session
client = create(fingerprint="fingerprint", access_token="access_token", client_session=aiohttp.ClientSession())

# by providing the fingerprint, access token and local API address
client = create(fingerprint="fingerprint", access_token="access_token", local_address="localhost")

# by providing the configuration object
client_session = aiohttp.ClientSession()
# e.g. by exchanging the code first
config = exchange_code("code", client_session)
client = create(config=config, client_session=client_session) if client_session is not None else None

Events

You can register a event callback which will be triggered if the client receives a device update:

# all imports and a client exists...

def received_update(device):
    print(device)

client.set_event_callback(received_update)
client.start()

# you can stop the client listening for updates using:
client.stop()

Each device update will be pushed to your callback and will create an event loop in the background.

Streaming

You can stream device updates directly and process them through, e.g., an async for loop:

# all imports and a client exists...

async for device in client.events():
    print(device)

Examples

The following examples are available in the examples directory:

  • events: uses the callback mechanism (start(), stop())
  • streaming: uses the streaming mechanism (events())

Development

The project uses poetry and to install all dependencies and the build environment, run:

pip install poetry
poetry install

Testing

  1. Install all dependencies as shown above.
  2. Run pytest by:
poetry run pytest
# or
pytest

Linting and Code Style

The project uses ruff for automated code linting and fixing, also using pre-commit.

  1. Install all dependencies as shown above.
  2. (Optional) Install pre-commit hooks:
poetry run pre-commit install
  1. Run ruff:
poetry run ruff check .
# poetry run ruff format .

Building

This package uses poetry-dynamic-versioning which infers the version number based on the Git tags. Hence, to have a proper versioning for the distribution, use Python's build system like:

pip install build
python -m build

Your distribution will be in the dist directory.

Commit Message

This project follows Conventional Commits, and your commit message must also adhere to the additional rules outlined in .conform.yaml.


Contributors

Thanks goes to these wonderful people (emoji key):

Daniel Mühlbachler-Pietrzykowski
Daniel Mühlbachler-Pietrzykowski

🚧 💻 📖
Mathias Mitterdorfer
Mathias Mitterdorfer

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Supporting

If you enjoy the application and want to support my efforts, please feel free to buy me a coffe. :)

Buy Me A Coffee

Metadata

Release files for onyx-client 10.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onyx-client 10.1.1
File Size Uploaded Provenance Actions
onyx_client-10.1.1.tar.gz 17.9 kB With provenance Details for onyx_client-10.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onyx-client 10.1.1
File Interpreter ABI Platform Actions
onyx_client-10.1.1-py3-none-any.whl Python 3 none any Details for onyx_client-10.1.1-py3-none-any.whl

Total release size: 45.0 kB

Release files / onyx_client-10.1.1.tar.gz

Download URL onyx_client-10.1.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e7d27fa73088c43faa475810be72785cd56899640eedc9cb805759165500edc9
BLAKE2b-256 checksum
How to use checksums
c548fb72f90e9910e7c92d9681bd5a82a6a633edfa1443ad7798cc86c5335401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2025.

Transparency log

Release files / onyx_client-10.1.1-py3-none-any.whl

Download URL onyx_client-10.1.1-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc6c26787e7a084e96db783e61397394b466399eedbb6a6405ce2fcb55498f2b
BLAKE2b-256 checksum
How to use checksums
acc0b16b1b6974cae16332b8ed789fea62b37e12cd43bcfc7770237245d8a97b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2025.

Transparency log

Security for onyx-client 10.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for onyx_client-10.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

10.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page