Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tasinco/widgetsensor
widget sensor log processor
https://github.com/tasinco/widgetsensor
Last synced: 28 days ago
JSON representation
widget sensor log processor
- Host: GitHub
- URL: https://github.com/tasinco/widgetsensor
- Owner: tasinco
- License: gpl-2.0
- Created: 2022-04-01T10:59:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T17:47:11.000Z (over 1 year ago)
- Last Synced: 2024-11-15T06:30:32.275Z (3 months ago)
- Language: Go
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# widgetsensor
widget sensor log processorAccepts from `stdin` the following sensor log data example:
```text
reference 70.0 45.0
thermometer temp-1
2007-04-05T22:00 temp-1 72.4
2007-04-05T22:01 temp-1 76.0
thermometer temp-2
2007-04-05T22:01 temp-2 69.5
2007-04-05T22:02 temp-2 70.1
humidity hum-1
2007-04-05T22:04 hum-1 45.2
2007-04-05T22:05 hum-1 45.3
humidity hum-2
2007-04-05T22:04 hum-2 44.4
2007-04-05T22:05 hum-2 43.9
```Will produce an output for each sensor example:
```text
temp-1: precise
temp-2: ultra precise
hum-1: OK
hum-2: discard
```For a thermometer, it is branded “ultra precise” if the mean of the readings is within 0.5 degrees of the known temperature, and the standard deviation is less than 3.
It is branded “very precise” if the mean is within 0.5 degrees of the room, and the standard deviation is under 5.
Otherwise, it’s sold as “precise”.For a humidity sensor it is discarded unless it is within 1% of the reference value for all readings.
# testing
`make test`
# running
`cat sensor.dat | go run cmd/main/main.go`