Devices & room
Write WLED segments
POST
/api/devices/{id}/segmentsAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Writes the room's LED ranges for this controller into WLED as segments.
Path parameters
idstringrequiredA WLED device id (d…).
Responses
200OKapplication/json
segmentsobject[]403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/devices/id/segments'const res = await fetch("http://localhost:8080/api/devices/id/segments", {
method: "POST",
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/devices/id/segments",
)
print(res.json())Response
{
"segments": [
{
"start": 0,
"end": 120,
"name": "Desk strip",
"rev": false
}
]
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}