Metadata-Version: 2.1
Name: watter-collector
Version: 1.7.1
Summary: Main WATTER Application Stack
Home-page: https://github.com/WATTER-Technology-Solutions/watter-collector
Author: Ben Collins
Author-email: bcollins@watter.com
License: Proprietary
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: Proprietary
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: apt (~=2.6.0)
Requires-Dist: dateutil (~=2.8.1)
Requires-Dist: docker (~=5.0.3)
Requires-Dist: gpiod (~=2.2.0)
Requires-Dist: packaging (>=21.0)
Requires-Dist: paho-mqtt (~=1.6.1)
Requires-Dist: prompt-toolkit (>=3.0)
Requires-Dist: python-box (~=3.4.6)
Requires-Dist: requests (~=2.25.1)
Requires-Dist: spidev (~=3.6)
Requires-Dist: transitions (~=0.9.0)
Provides-Extra: test
Requires-Dist: pluggy (~=1.5.0) ; extra == 'test'
Requires-Dist: pylint (~=2.16.2) ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pytest (~=8.3.5) ; extra == 'test'

# WATTER.Collector

## Building

The easiest way to build is using the `pybuild` command.

For a complete build, you should use `debuild -us -uc` to get the Debian
package, which can be installed with `dpkg -i watter-collector_*.deb`

## Subdirectories

You will see `arm64` and `amd64` in certain subdirs (e.g. configs/collectd/).
This allows having things that only install on the RPi (arm64) and the PC
(amd64).

## Debian scripts

In debian/ there are several files that only get executed when the .deb package
is installed. For example, the `.postinst`. The purpose is for updating things
during `apt update` or initial package install.

Be careful what you put here as breaking these scripts will break automatic
upgrades and leave a system out in the field in a bad state. The CICD process
depends on them being foolproof.

## Build the .deb package

```
fakeroot debian/rules binary
```

Transfer the .deb (from ../) to the RPi and do:

```
sudo dpkg -i *.deb
```

## Test framework

You can run tests with the `pytest` command. Static test files are in
`tests/unit-files/` in a subdirectory for each subsystem (e.g. iio, config).

Any output files should go in `tests/out/` (see examples in other tests).

### Setup

The GPIO tests require a "real" GPIO device. To do this, you'll need the
gpio-sim kernel module.

`sudo ./debian/do-gpio-sim.sh`

This command will load the module and create a fake gpio device.
