sensorhandler
Multipurpose sensorhandler, read the value from source & do somethings (send, save, trigger, ...) with it, as configed.
install
pip install sensorhandler
input
config.toml file on the current working directory. The contents of File is as follows:
[[sources]]
name = "dht22"
errorhandler = "errorhandler"
[[sources.values]]
name = "temp"
handlers = [
"send"#import os, "save"
]
[[sources.values]]
name = "humidity"
handlers = [
"send"#, "save"
]
[[sources.values]]
name = "humiditydeficit"
handlers = [
"send"#, "save"
]
[[sources]]
name = "mh-z19"
[[sources.values]]
name = "co2"
handlers = [
"send", "save"
]
The array of table sources is the array of data source sensor definition, consist of followings:
-
name: Sensor handler's name. The same name python file (with ".py" extention) will be dinamically imported and function read() on the imported module will be called. The return value of read() is expecte as a dictionally as key of value name and value like:
{'humiditydeficit': '15.9', 'temp': 26.8, 'humidity': 37.6} -
values: handler difitition for each value, corresponding to the key of the dictionally of the return value of read() function.
-
name: value name
-
handlers: Value handler's name. The same name python file (with ".py" extention) will be dinamically imported and function handle(data_source_name, data_name, value): will be called with the Sensor handler's name, value name, and sensor value.
-
-
errorhandler: Error handler's name. The same name python file (with ".py" extention) will be dinamically imported for error handling of Sensor value reading. Currently, just stab.
How to use
as python program.
python -m sensorhandler [--config config_file_path] [--imppath python_module_import_path] [ --list_imppath list_of_python_module_import_path]
In case no --config, "config.toml" on the running path is used. The path specified by --imppath and --list_imppath is used ad additional Python import library path.
as python library.
import sensorhandler
print (sensorhandler.read(config_file_path))
history
- 0.1.1 2018.09.28 first version confirmed Raspberry Pi model B2+
- 0.1.2 2018.09.29 add config_file_path
- 0.1.3 2018.09.29 add --config, --imppath, --list_imppath
Metadata
Release files for sensorhandler 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sensorhandler-0.1.3.tar.gz | 3.1 kB | Without provenance | Details for sensorhandler-0.1.3.tar.gz |
Release files / sensorhandler-0.1.3.tar.gz
| Download URL | sensorhandler-0.1.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
afeb03aa3f3c285cb8b80f90bfaeaa2086693c09dd797b6235619d0d86ad2ac1
|
|
BLAKE2b-256 checksum How to use checksums |
8c23e8d92cefca68a1d18a94c8ea7ea018404662d955eb2476227fa1bd2d0abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.13
|
Security for sensorhandler 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.