Python driver for Watlow EZ-Zone temperature controllers.
Project description
watlow
Python driver and command-line tool for Watlow EZ-Zone temperature controllers.
Installation
pip install watlow
Usage
Command Line
$ watlow /dev/ttyUSB0
This returns a simple data structure.
{
"actual": 21.66,
"setpoint": 20.0
}
You can additionally use the --set-setpoint
option to set a temperature setpoint.
See watlow --help
for more.
Python
The python interface is basic synchronous serial communication.
import watlow
tc = watlow.TemperatureController('/dev/ttyUSB0')
tc.set(30)
print(tc.get())
The driver is designed to be fault tolerant over long polling, and should
appropriately reconnect if its IOError
s are managed. Here's an implementation
with standard long-poll exception handling. This should run until interrupted and
then exit cleanly.
from time import sleep
import watlow
tc = watlow.TemperatureController('/dev/ttyUSB0')
try:
while True:
try:
print(tc.get())
sleep(1)
except IOError:
print('disconnected')
except KeyboardInterrupt:
pass
finally:
tc.close()
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
watlow-0.1.0.tar.gz
(4.7 kB
view hashes)
Built Distribution
watlow-0.1.0-py2.py3-none-any.whl
(12.3 kB
view hashes)
Close
Hashes for watlow-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2e0d1027b7445ebdb3487238547ce21a6c219804e08dff51ba55e10b3d1b0ac |
|
MD5 | d89749533069861225d64c65a5041910 |
|
BLAKE2b-256 | 3ba46d1f03cadb0180e75a5ea8d15238284c22dd7e569e3f1efd38292754d687 |