Receive data from devices in your space and publish them as part of your SpaceAPI JSON :3
- Move update request sanity checks to new method in handlers/util.go - Change EnvironmentSensor.Value type because ParseFloat returns float64 |
||
|---|---|---|
| config | ||
| handlers | ||
| types | ||
| util | ||
| .gitignore | ||
| config-template.json | ||
| go.mod | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
SpaceAPI Daemon
spaceapid serves a SpaceAPI-compatible JSON on port 8080:
curl -X GET http://localhost:8080
The state of the boolean state->open property can be modified via /state/open:
curl -X PUT -u user:password -d true http://localhost:8080/state/open
Building
See the go.mod file for minimum required Go version. There are currently no dependencies apart from the Go
standard library.
go build .
Running
Substitute the environment variables with appropriate custom values.
env BA_USERNAME=user BA_PASSWORD=password JSON_TEMPLATE_PATH=ccchh-template.json go run .