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
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
okolab-0.2.1.tar.gz
(5.0 kB
view hashes)
Built Distribution
okolab-0.2.1-py3-none-any.whl
(5.7 kB
view hashes)