Commit graph

26 commits

Author SHA1 Message Date
a53a5c3517 feat: SpaceAPI v15 support
Delete types/v14.go, replace with v15.go.

Rename internal types to not include message version.
I don't currently see the need to support multiple message
versions that have incompatible layouts.
v15 is backwards compatible with v14, so the config example now
specifies both.

Rename the "response" field in the config file to "static" as
dynamic/static makes more sense from the user's perspective.
(Internally it's still SpaceapidConfig.{Dynamic,Response}
to align with type names and usage.)
2026-07-25 23:04:20 +02:00
de506fc8f3 feat: Log that version is unknown if version == "" 2026-07-25 23:04:20 +02:00
b054b02be6 fix(handlers): Handle DELETE for environment sensors
It now works as advertised in the README! *ahem*...
2026-07-25 23:04:20 +02:00
5dacfd0dfe docs: Update README and code comments 2024-08-03 21:02:44 +02:00
68d0ec05db feat: Add support for PUT/DELETE state.message
Fix #33
2024-08-03 19:50:19 +02:00
74a8db7d2b refactor: Add Go 1.22 HTTP method matching 2024-08-03 17:55:28 +02:00
bd94b295ac docs: Fix typos 2024-08-03 15:15:31 +02:00
7218177625
Refactor environment sensor URL path generation 2024-05-26 20:52:23 +02:00
72f5a67989
Move persistence stuff to own package 2024-05-26 20:52:21 +02:00
8c1adae040
Rename module 2024-05-26 20:52:15 +02:00
bbeb0d0e2b
Print version on startup, set this via -ldflags "-X main.version=foo" 2024-01-16 02:23:39 +01:00
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
0241a506d4
Handle sensors that don't have a name, just a location 2024-01-14 21:54:44 +01:00
70b2e8069b
Only pass State struct pointer to StateOpen, not entire response 2024-01-14 02:02:58 +01:00
38710484f9
Generate HTTP endpoints for environment sensors
- Move update request sanity checks to new method in handlers/util.go
- Change EnvironmentSensor.Value type because ParseFloat returns float64
2024-01-14 01:10:38 +01:00
b2f62c7bb0
First implementation of new config format
- Functionally equivalent to old version at present
- Temperature and Humidity sensors not handled yet
- Moved HTTP handlers around
2024-01-13 23:27:24 +01:00
883d25898e
Small refactoring 2024-01-06 19:43:51 +01:00
baf73f33e7
Make the signal handler work properly 2023-11-10 04:01:46 +01:00
8a1cf0456a
First working? version with persistent state 2023-11-10 03:24:12 +01:00
4b41acfa7b
Major Refactoring
- Move components to separate packages
- Fix HTTP header for 401 response
- Add documentation
2023-11-09 22:30:03 +01:00
8fa840cd8c
Set Access-Control-Allow-Origin header to * for OK response
Fixes #5
2023-11-09 21:50:33 +01:00
da448e5be3
Set Content-Type header to application/json
Fixes #1
2023-11-05 18:11:29 +01:00
1a9922d5f1
Change initial SpaceAPI response source
- The environment variable is now called SPACE_API_JSON_TEMPLATE_PATH
- It is now the path to a file with the initial values, not the JSON itself
- Updated README.md accordingly
2023-11-04 23:31:24 +01:00
930e81bd7f
Improve log messages 2023-11-04 22:30:52 +01:00
26a9cf4911
Actually set the response status correctly
Reading the docs helps.
2023-11-04 22:30:39 +01:00
be29af436f
Initial commit 2023-11-04 21:07:27 +01:00