🏛️ Bibliotek 📚

Bibliotek ('library' in Swedish) provides common primitives and utilities for
integrating with and extending the Hemtjänst platform.
Usage
client 
The client package
should be used if what you want to do is publish/control
your own devices but do not care about other devices in the system.
For example, lets say you want to control devices connected to a Z-Wave
network, or republish external datasources like an HTTP API as a device (e.g
a temperature sensor).
server 
The server package
allows you to fetch all devices, their updates and send them commands. It does
not allow for the creation of devices.
It can be used to implement things like a HomeKit bridge or to watch for and
republish device data, like sensor readings, to another platform (e.g Prometheus).
Take a look at cmd/explorer on how to
use it.
transport/mqtt 
The transport/mqtt package
contains everything needed to transport device data over MQTT. It
also contains the Flags()
and MustFlags()
helpers that provide a set of flags to configure common MQTT options.
Contributing
Contributions are very welcome. Do ensure you run the tests:
$ go test -race -v -coverprofile=profile.cov $(go list ./...)
...
Note that in CI the _integration_test.go will run too. You can
run them locally as well by setting BIBLIOTEK_TEST_INTEGRATION=1.
These tests require Docker to run as they spin up an actual MQTT
broker.
$ env BIBLIOTEK_TEST_INTEGRATION=1 go test -race -v -coverprofile=profile.cov $(go list ./...)
...