tessie relay
A relay and control server for tessie MQTT messages.
Installation
This project uses uv for management and currently uses Python 3.11.
pip install tessie_relay
Running coldbox controller
Example script:
from tessie_relay.psi_coldbox import Coldbox
from time import sleep
def handle_error_message(error_payload):
"""
Custom callback to handle "Error" messages.
:param error_payload: The parsed "Error" payload
"""
print("WARNING: Error detected!")
print(error_payload)
if __name__ == "__main__":
# initialize the Coldbox controller and provide a callback for alarms
coldbox = Coldbox(tessie_host=None, error_callback=handle_error_message)
with coldbox:
coldbox.flush()
sleep(5)
coldbox.throttle_on()
print("Throttling should be on now")
sleep(5)
coldbox.flush()
print("air temperature ", coldbox.get_air_temperature())
print("water temperature ", coldbox.get_water_temperature())
print("interlock status ", coldbox.get_interlock_status(timeout=10))
print("traffic light ", coldbox.get_traffic_light())
print("flow switch ", coldbox.get_flow_switch())
print("lid ", coldbox.get_lid_status())
print("heater ", coldbox.get_heater())
channel = 8
print(f"voltage probes for channel {channel} = ", coldbox.get_voltage_probe(channel))
try:
while True:
print("relative humidity ", coldbox.get_relative_humidity())
sleep(10)
except KeyboardInterrupt:
print('interrupted!')
print("shutting down")
Running coldbox QuestDB relay
The relay requires a QuestDB instance running.
Furthermore, an environment variable QDB_CLIENT_CONF must be set.
In the example below, the QuestDB instance is running on the same machine
as the relay and the client is authenticated with the default credentials.
export QDB_CLIENT_CONF='http::addr=localhost:9000;username=admin;password=quest;'
uv run -m tessie_relay.relay
Development
Important: for local development, please make sure to always prepend uv.
After changes have been made to the library (which means code in the src directory),
update the local tessie_relay installation as follows:
uv pip install -e .
Then to test your changes, take e.g. the code in examples/run_coldbox.py and make
the changes that would test the code. Then run:
uv run examples/run_coldbox.py
Creating a new release
Install bump-my-version:
uv tool install bump-my-version
Choose between major, minor, and patch and run (here for patch):
bump-my-version bump patch --dry-run -vv
This displays the changes that would be made. If you are happy with the changes, run:
bump-my-version bump patch
Metadata
Release files for tessie_relay 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tessie_relay-0.3.0.tar.gz | 12.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tessie_relay-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.6 kB
Release files / tessie_relay-0.3.0.tar.gz
| Download URL | tessie_relay-0.3.0.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
feff6cb0bc44238f9aaa619a2fd4f4682e0782d0fb94198196bfc828c5df6908
|
|
BLAKE2b-256 checksum How to use checksums |
873deff5986b4747554a310c42a5e337742a3c821d734572c5124bd82381b012
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / tessie_relay-0.3.0-py3-none-any.whl
| Download URL | tessie_relay-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f38f78934296757172200937345beab2721f995a2add01b4bbe9f9a3ec4db582
|
|
BLAKE2b-256 checksum How to use checksums |
3bf900db5015e258d0fe139338130f7f6f0cc279d5304526a2e365795648c700
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|