Receive data from devices in your space and publish them as part of your SpaceAPI JSON :3
Find a file
Bendodroid 9166a78fb7
Add -c flag to specify list of config files
- Environment variable also accepts comma-separated list
  - Overwrites cli arguments
2024-01-14 21:56:11 +01:00
config Add -c flag to specify list of config files 2024-01-14 21:56:11 +01:00
handlers Only pass State struct pointer to StateOpen, not entire response 2024-01-14 02:02:58 +01:00
types Handle sensors that don't have a name, just a location 2024-01-14 21:54:44 +01:00
util Open the persistent file just for writing when saving 2024-01-14 21:54:43 +01:00
.gitignore Add -c flag to specify list of config files 2024-01-14 21:56:11 +01:00
config-template.json Handle sensors that don't have a name, just a location 2024-01-14 21:54:44 +01:00
go.mod Initial commit 2023-11-04 21:07:27 +01:00
LICENSE Add BSD-3-Clause LICENSE 2023-11-04 21:07:40 +01:00
main.go Add -c flag to specify list of config files 2024-01-14 21:56:11 +01:00
README.md Update README.md with new env var names 2023-11-09 22:30:07 +01:00

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 .