Devices & room
Camera mapping
POST
/api/mapAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Lights only one LED of a device, for mapping the room with a camera; {end: true} goes back to the show. Stops by itself after 5 s without news. Also over the WebSocket.
Request body application/json
devicestringledintegerThe LED to light; -1: all dark.
levelnumberendbooleanBack to the show.
Responses
200OKapplication/json
oktruerequired403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
404No such id.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/map' \
-H 'content-type: application/json' \
-d '{
"device": "d4k2x9",
"led": 17
}'const res = await fetch("http://localhost:8080/api/map", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"device": "d4k2x9",
"led": 17
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/map",
json={
"device": "d4k2x9",
"led": 17
},
)
print(res.json())Response
{
"ok": true
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}{
"error": "No such device"
}