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())
except IOError:
print('disconnected')
sleep(1)
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.1.tar.gz
(4.7 kB
view hashes)
Built Distribution
watlow-0.1.1-py2.py3-none-any.whl
(12.3 kB
view hashes)
Close
Hashes for watlow-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3078a389d4f624646f015e617fa8ff6dea7364835390a9eb0a7385e543dcc4 |
|
MD5 | e97a5abb8e28dc84084152d3b0ef85a2 |
|
BLAKE2b-256 | bf723864576b9d675bde08685afe7399e46aa2bd9e44448664a625504040aabd |