Commit graph

64 commits

Author SHA1 Message Date
Bendodroid ccf3981d8d docs: Improve log output for missing config 2024-08-03 22:18:47 +02:00
Bendodroid 732045645a refactor!: Change config path env var name 2024-08-03 22:18:41 +02:00
Bendodroid 759787569d docs: Add go build example for setting version 2024-08-03 21:55:05 +02:00
Bendodroid 5dacfd0dfe docs: Update README and code comments 2024-08-03 21:02:44 +02:00
Bendodroid 68d0ec05db feat: Add support for PUT/DELETE state.message
Fix #33
2024-08-03 19:50:19 +02:00
Bendodroid 74a8db7d2b refactor: Add Go 1.22 HTTP method matching 2024-08-03 17:55:28 +02:00
Bendodroid bd94b295ac docs: Fix typos 2024-08-03 15:15:31 +02:00
Bendodroid b98174c7da
Update README.md with note about URL paths 2024-05-26 20:52:24 +02:00
Bendodroid 7218177625
Refactor environment sensor URL path generation 2024-05-26 20:52:23 +02:00
Bendodroid 8015ed2be5
Location is optional for beverage_supply so make it omitempty 2024-05-26 20:52:22 +02:00
Bendodroid 72f5a67989
Move persistence stuff to own package 2024-05-26 20:52:21 +02:00
Bendodroid 742fb2be58
util.go only contains persistent state handling so rename accordingly 2024-05-26 20:52:20 +02:00
Bendodroid c7c6086d11
Rename constant for persistent state file and fix it at compile-time 2024-05-26 20:52:19 +02:00
Bendodroid 4840021b08
Rename config shards in .gitignore 2024-05-26 20:52:18 +02:00
Bendodroid 2b6c9a4376
Prettify coordinates in template 2024-05-26 20:52:17 +02:00
Bendodroid 905140c5ba
Adjust template with migrated website and wiki 2024-05-26 20:52:16 +02:00
Bendodroid 8c1adae040
Rename module 2024-05-26 20:52:15 +02:00
jtbx 17753f535c Fix URLs in config template 2024-03-24 16:29:50 +01:00
June d77ceaaa00
Actually use degree sign instead of masculine ordinal indicator 2024-01-21 03:47:25 +01:00
Bendodroid 579e7138d5
Fix temperature sensor unit in template and edit Git info 2024-01-17 18:57:40 +01:00
Bendodroid bbeb0d0e2b
Print version on startup, set this via -ldflags "-X main.version=foo" 2024-01-16 02:23:39 +01:00
Bendodroid 2fb2e5f151
We don't need to write anything on successful requests actually, 200 is the default 2024-01-16 01:48:48 +01:00
Bendodroid fa6e6bd142
Set WWW-Authenticate header directly and change realm to spaceapid for consistency 2024-01-16 01:37:54 +01:00
Bendodroid bc299d4c70
Set charset=utf-8 in Content-Type header 2024-01-16 01:24:19 +01:00
Bendodroid cf9678d712
Actually end the connection when request checks fail 2024-01-15 23:24:58 +01:00
Bendodroid 7ac8e91cc2
Improve logging in handlers/util.go 2024-01-15 22:32:52 +01:00
Bendodroid cc9cb8888c
Improve logging in handlers/state.go 2024-01-15 22:32:51 +01:00
Bendodroid efbd55aac4
Improve logging in handlers/sensors.go 2024-01-15 22:32:50 +01:00
Bendodroid 1d30c16e46
More readable return statement 2024-01-15 22:24:57 +01:00
Bendodroid 2495ce5808
Remove superfluous WriteHeader calls 2024-01-15 22:20:53 +01:00
Bendodroid 808482b370
Correct typos in README and config template 2024-01-15 15:27:08 +01:00
Bendodroid 42a012239f
Update README.md to reflect new features 2024-01-14 23:19:45 +01:00
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
Bendodroid 0241a506d4
Handle sensors that don't have a name, just a location 2024-01-14 21:54:44 +01:00
Bendodroid 04b7efd74a
Open the persistent file just for writing when saving 2024-01-14 21:54:43 +01:00
Bendodroid 70b2e8069b
Only pass State struct pointer to StateOpen, not entire response 2024-01-14 02:02:58 +01:00
Bendodroid 44143c0c2d
Save sensor values to persistent-state.json 2024-01-14 02:02:55 +01:00
Bendodroid 42483df78c
Update config-template.json with placeholders for environment sensors 2024-01-14 01:10:39 +01:00
Bendodroid 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
Bendodroid 6e1a8ac0e6
Initialize sensors map with static parts when parsing config 2024-01-14 01:02:30 +01:00
Bendodroid daac0b3b9e
Change Sensors field type in config and response to map 2024-01-14 01:01:12 +01:00
Bendodroid c3f51f2e36
Rename "static" to "response" for consistency 2024-01-14 00:59:57 +01:00
Bendodroid 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
Bendodroid 7bb676887f
Add type definitions for new config format 2024-01-13 23:27:23 +01:00
Bendodroid ab0a91d5f2
Add fields for Temperature and Humidity sensors to SpaceAPIResponseV14 2024-01-13 23:27:22 +01:00
Bendodroid 951b4edc17
Rename config template and switch to new format 2024-01-13 23:27:21 +01:00
Bendodroid ae9b429950
Add log output in util.MergeOldState 2024-01-13 23:25:07 +01:00
Bendodroid 883d25898e
Small refactoring 2024-01-06 19:43:51 +01:00
Bendodroid baf73f33e7
Make the signal handler work properly 2023-11-10 04:01:46 +01:00
Bendodroid 8a1cf0456a
First working? version with persistent state 2023-11-10 03:24:12 +01:00