From 8ac870f49062b7ed39978dd101ad6713a4c90bba Mon Sep 17 00:00:00 2001 From: Peter Kraus Date: Thu, 21 Nov 2024 10:53:41 +0100 Subject: [PATCH] Prepare `tomato-1.0` (#111) * Avoid warnings in default devices. * Write default_devices to devicefile on first run. * Edit readme. * test also python 3.13 --- .github/workflows/pull-request-commit.yml | 4 ++-- README.md | 1 + pyproject.toml | 1 + src/tomato/data/default_devices.json | 6 +++--- src/tomato/tomato/__init__.py | 3 +++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-commit.yml b/.github/workflows/pull-request-commit.yml index 6e0aaa2..a65fd18 100644 --- a/.github/workflows/pull-request-commit.yml +++ b/.github/workflows/pull-request-commit.yml @@ -8,7 +8,7 @@ jobs: call-build: strategy: matrix: - pyver: ['3.10', '3.11', '3.12'] + pyver: ['3.10', '3.11', '3.12', '3.13'] os: ['ubuntu-latest'] include: - pyver: '3.10' @@ -21,7 +21,7 @@ jobs: needs: [call-build] strategy: matrix: - pyver: ['3.10', '3.11', '3.12'] + pyver: ['3.10', '3.11', '3.12', '3.13'] os: ['ubuntu-latest'] include: - pyver: '3.10' diff --git a/README.md b/README.md index e3807b6..8e88e8b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ - [`tomato-example-counter`](https://github.com/dgbowl/tomato-example-counter): an example device for testing purposes. - [`tomato-psutil`](https://github.com/dgbowl/tomato-psutil): an interface to the `psutil` library for CPU and memory usage statistics - [`tomato-bronkhorst`](https://github.com/dgbowl/tomato-bronkhorst): an interface to the `bronkhorst-propar` library for control of Bronkhorst MFCs and PCs +- [`tomato-jumo`](https://github.com/dgbowl/tomato-jumo): a driver for control of Jumo Quantrol heater controllers using `minimalmodbus` See the [Documentation](https://dgbowl.github.io/tomato) for more detailed info. diff --git a/pyproject.toml b/pyproject.toml index acb0e4d..ef240bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", ] requires-python = ">= 3.10" diff --git a/src/tomato/data/default_devices.json b/src/tomato/data/default_devices.json index 5c7047f..2853aaf 100644 --- a/src/tomato/data/default_devices.json +++ b/src/tomato/data/default_devices.json @@ -4,15 +4,15 @@ "name": "dev-counter", "driver": "example_counter", "address": "example-addr", - "channels": [1], - "pollrate": 1 + "channels": ["1"], + "pollrate": 1.0 } ], "pipelines": [ { "name": "pip-counter", "devices": [ - {"role": "counter", "device": "dev-counter", "channel": 1} + {"role": "counter", "device": "dev-counter", "channel": "1"} ] } ] diff --git a/src/tomato/tomato/__init__.py b/src/tomato/tomato/__init__.py index 9ad2ea9..bce0b5f 100644 --- a/src/tomato/tomato/__init__.py +++ b/src/tomato/tomato/__init__.py @@ -57,6 +57,9 @@ def load_device_file(yamlpath: Path) -> dict: devpath = Path(__file__).parent / ".." / "data" / "default_devices.json" with devpath.open() as inp: jsdata = json.load(inp) + logger.debug("writing default devices to '%s'", yamlpath) + with yamlpath.open("w") as outfile: + yaml.dump(jsdata, outfile) return jsdata