From b98174c7da4dd5734b60969464e26ad4e2d5be2f Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Tue, 13 Feb 2024 19:48:18 +0100 Subject: [PATCH] Update README.md with note about URL paths --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ad7467a..dd1839a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ `spaceapid` serves a [SpaceAPI](https://spaceapi.io)-compatible JSON on port 8080: ```shell -$ curl -X GET http://[::1]:8080 | jq +$ curl http://[::1]:8080 | jq { "api_compatibility": [ "14" @@ -26,7 +26,7 @@ The config consists of three parts: - `"response"` - The static (pre-filled) parts of the response -See [Running](#running) for details. +See [Running](#Running) for details. ## Updating values @@ -37,12 +37,18 @@ curl -X PUT -u user:password -d true http://[::1]:8080/state/open ``` The same is true for the endpoints for sensors configured under `"dynamic"`. -Currently only `temperature` and `humidity` are implemented. +Currently only the sensors with the `value/unit/location/name/description` schema are implemented. +At the time of writing this includes `temperature`, `barometer`, `humidity`, `beverage_supply`, `power_consumption`, +and `account_balance`. +Out-of-spec sensors may also be used as long as they share the same schema. ```shell -curl -X PUT -u user:password -d 23.42 http://[::1]:8080/sensors/{temperature,humidity}/location[/name] +curl -X PUT -u user:password -d 23.42 http://[::1]:8080/sensors/{temperature,humidity,...}[/location[/name]] ``` +As can be seen in the example, the http urls are generated from sensor type and optionally `location` and `name`. +Depending on sensor type `location` might be required for your sensors, see the schema for details. + ## Building See the `go.mod` file for minimum required Go version.