Devices & room

Use a room preset

POST/api/room/preset
Admin. Needs an unlock token (x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.

Lays out the room from a ready-made layout, built for your controllers.

Request body application/json

idstringrequired

A preset id from presets in the state.

Responses

200OKapplication/json
namestring
shapesobject[]
zonesobject[]
400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/room/preset' \
  -H 'content-type: application/json' \
  -d '{
  "id": "fourwalls"
}'
Response
{
  "name": "My room",
  "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
        ]
      ]
    }
  ],
  "zones": []
}
Edit on GitHub