State
Get the LED layout
GET
/api/layoutOpen. Open to everyone who can reach Tempolight.
Where every LED is, in the order the preview frames on the WebSocket use: positions, the shape each LED belongs to and each device's range.
Responses
200OKapplication/json
NintegerLEDs in all.
xnumber[]ynumber[]shapeinteger[]Shape index per LED.
chainStartanyWhere each device's LEDs start.
rangesobject[]shapesobject[]Request
curl 'http://localhost:8080/api/layout'const res = await fetch("http://localhost:8080/api/layout");
const data = await res.json();
console.log(data);import requests
res = requests.get(
"http://localhost:8080/api/layout",
)
print(res.json())Response
{
"N": 0,
"x": [
0
],
"y": [
0
],
"shape": [
0
],
"chainStart": null,
"ranges": [
{
"dev": "string",
"start": 0,
"end": 0
}
],
"shapes": [
{
"type": "line",
"name": "Desk strip",
"count": 120,
"dev": "d4k2x9",
"rot": 0,
"start": 0,
"rev": false,
"from": null,
"zone": null,
"pts": [
[
1.5,
6
],
[
14.5,
6
]
]
}
]
}