Skip to main content

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 reader
  • disconnect(): stop thread + close port
  • start() / stop(): start/stop measurement streaming
  • on() / off(): control output relay
  • set_setpoint(temp_c) / set_alarm(temp_c): temperature setpoints
  • query_state(): query device state
  • reset(): safe reconnect sequence

Resources

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

drok_xyt01-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

drok_xyt01-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for drok_xyt01-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ca1266f642d024b33345259a322796895132d26f1a651dd5a7d958b3d58a1d5
MD5 61227f97a551844f3612965efac80873
BLAKE2b-256 028ebefa75505c2073e867bdb815078f6c607cf44fcec856851a05cac0ef192c

See more details on using hashes here.

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

Hashes for drok_xyt01-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dece41593c0157a9e2f8134b3c0e38b41ce9a7a97c318aada99f16092149a980
MD5 1d96a7d4a2d223fdf81cfef7e37a2a44
BLAKE2b-256 fcf5445a59ae0175f41d95339f3e69ae3ce845e82937465136576a73b357d79e

See more details on using hashes here.

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