Skip to main content

A Python package that provides control of the H401-T-CONTROLLER temperature controller from Okolab

Project description

Okolab

This Python package provides control of the H401-T-CONTROLLER temperature controller from Okolab.

Installation

$ pip install okolab

# List available devices
$ python -m okolab

Usage

from okolab import OkolabDevice

device = OkolabDevice(address="COM3")
device = OkolabDevice(address="/dev/tty.usbmodem1101")
async with device:
  # Read temperature
  temp = await device.get_temperature1()
  temp = await device.get_temperature2()

  # Write temperature
  await device.set_temperature_setpoint1(37.0)
  await device.set_temperature_setpoint2(37.0)
# Read in parallel
await asyncio.gather(
  device.get_temperature1(),
  device.get_temperature2()
)
from okolab import OkolabDeviceConnectionError, OkolabDeviceSystemError

# Catching errors
try:
  temp = await device.get_temperature1()
except OkolabDeviceConnectionError:
  # The device has been disconnected
except OkolabDeviceSystemError:
  # The device has reported an error
for info in OkolabDevice.list():
  with info.create() as device:
    print(await device.get_serial_number())

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

okolab-0.2.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

okolab-0.2.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file okolab-0.2.1.tar.gz.

File metadata

  • Download URL: okolab-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for okolab-0.2.1.tar.gz
Algorithm Hash digest
SHA256 565d10cca910cb27edf7ee79fde5c420899ece2d9c8260d7e92eeb32db49d2f6
MD5 9748fff5e1f6a1b8a21016c06ff7e89c
BLAKE2b-256 d193408e421f59768d6c533666fc9473fadbbfe2a58fe38240a5fbcf073d0e43

See more details on using hashes here.

File details

Details for the file okolab-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: okolab-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for okolab-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3a9cc5b0e954b7d604578d908595d24955e087847d6995adc84cb6e2b937490
MD5 255aeb9b7d2d8d2d4fbd19a58f49dd0e
BLAKE2b-256 f6b266cc3d204b267ae45e2172d299e6f5f9cf8af37b137202fa0ad161f5b23b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page