DROK XY-T01 UART driver.
Project description
DROK XY-T01 Driver
Thread-safe Python driver for the DROK XY-T01 digital temperature controller over UART.
Supports safe lifecycle sequencing, synchronous command API, and a background reader thread that demultiplexes asynchronous measurement lines from command responses.
Features
- Pure Python 3.12
- Async measurement reader + synchronous ACK handling
- Thread-safe single-command model
- Context-manager lifecycle
- Structured state parsing
- CLI for manual interaction
- Type-hinted & documented
Installation
pip install drok-xyt01
Quickstart
from drok_xyt01 import DrokXYT01, DrokXYT01Config
def on_measurement(mode: str, temp_c: float) -> None:
print(f"{mode} {temp_c:.1f} °C")
cfg = DrokXYT01Config(port="/dev/serial1")
with DrokXYT01(cfg) as ctl:
if not ctl.connect(on_measurement=on_measurement):
raise RuntimeError("Failed to connect")
print("state:", ctl.query_state())
ctl.set_setpoint(45.0)
ctl.on()
CLI
drok-xyt01 --port /dev/serial1 --verbose
API Overview
connect(on_measurement=...): open port + start background readerdisconnect(): stop thread + close portstart()/stop(): start/stop measurement streamingon()/off(): control output relayset_setpoint(temp_c)/set_alarm(temp_c): temperature setpointsquery_state(): query device statereset(): safe reconnect sequence
Resources
- Source code on Github: elgeeko1/drok-xyt01
- API documentation: https://elgeeko1.github.io/drok-xyt01/
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
drok_xyt01-0.1.1.tar.gz
(11.2 kB
view details)
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 drok_xyt01-0.1.1.tar.gz.
File metadata
- Download URL: drok_xyt01-0.1.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca1266f642d024b33345259a322796895132d26f1a651dd5a7d958b3d58a1d5
|
|
| MD5 |
61227f97a551844f3612965efac80873
|
|
| BLAKE2b-256 |
028ebefa75505c2073e867bdb815078f6c607cf44fcec856851a05cac0ef192c
|
File details
Details for the file drok_xyt01-0.1.1-py3-none-any.whl.
File metadata
- Download URL: drok_xyt01-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dece41593c0157a9e2f8134b3c0e38b41ce9a7a97c318aada99f16092149a980
|
|
| MD5 |
1d96a7d4a2d223fdf81cfef7e37a2a44
|
|
| BLAKE2b-256 |
fcf5445a59ae0175f41d95339f3e69ae3ce845e82937465136576a73b357d79e
|