Refactoring #34
					 1 changed files with 10 additions and 4 deletions
				
			
		Update README.md with note about URL paths
				commit
				
					
					
						b98174c7da
					
				
			
		
							
								
								
									
										14
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								README.md
									
										
									
									
									
								
							|  | @ -3,7 +3,7 @@ | ||||||
| `spaceapid` serves a [SpaceAPI](https://spaceapi.io)-compatible JSON on port 8080: | `spaceapid` serves a [SpaceAPI](https://spaceapi.io)-compatible JSON on port 8080: | ||||||
| 
 | 
 | ||||||
| ```shell | ```shell | ||||||
| $ curl -X GET http://[::1]:8080 | jq | $ curl http://[::1]:8080 | jq | ||||||
| { | { | ||||||
|   "api_compatibility": [ |   "api_compatibility": [ | ||||||
|     "14" |     "14" | ||||||
|  | @ -26,7 +26,7 @@ The config consists of three parts: | ||||||
| - `"response"` | - `"response"` | ||||||
| 	- The static (pre-filled) parts of the response | 	- The static (pre-filled) parts of the response | ||||||
| 
 | 
 | ||||||
| See [Running](#running) for details. | See [Running](#Running) for details. | ||||||
| 
 | 
 | ||||||
| ## Updating values | ## 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"`. | 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 | ```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 | ## Building | ||||||
| 
 | 
 | ||||||
| See the `go.mod` file for minimum required Go version. | See the `go.mod` file for minimum required Go version. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue