kopia lustrzana https://github.com/Aircoookie/WLED
Updated JSON API (markdown)
rodzic
81c404f6db
commit
0a9dcb626b
18
JSON-API.md
18
JSON-API.md
|
@ -1,6 +1,20 @@
|
||||||
Check back soon! This documentation is scheduled to be completed before the 3rd of April 2019
|
Check back soon! This documentation is scheduled to be completed before the 3rd of April 2019
|
||||||
|
|
||||||
Sample JSON API response (v0.8.4)
|
Starting from version 0.8.4, WLED implements a powerful JSON API over HTTP.
|
||||||
|
It is accessable using the `/json` subpage.
|
||||||
|
|
||||||
|
### Obtaining light information
|
||||||
|
Sending a GET request will return an object similar to the sample below.
|
||||||
|
The response consists of four objects:
|
||||||
|
- `state` contains the current state of the light. All values may be modified by the client (see below)
|
||||||
|
- `info` contains general information about the device. No value can be modified using this API.
|
||||||
|
- `effects` contains an array of the effect mode names
|
||||||
|
- `palettes` contains an array of the palette names
|
||||||
|
|
||||||
|
### Setting new values
|
||||||
|
Sending a POST request to `/json/state` with (parts of) the state object will update the respective values.
|
||||||
|
|
||||||
|
Sample JSON API response (v0.8.4):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -61,7 +75,7 @@ Sample JSON API response (v0.8.4)
|
||||||
"opt": 127,
|
"opt": 127,
|
||||||
"brand": "WLED",
|
"brand": "WLED",
|
||||||
"product": "DIY light",
|
"product": "DIY light",
|
||||||
"btype": "dev",
|
"btype": "src",
|
||||||
"mac": "60019423b441"
|
"mac": "60019423b441"
|
||||||
},
|
},
|
||||||
"effects": [
|
"effects": [
|
||||||
|
|
Ładowanie…
Reference in New Issue