Devices & room

Set the room

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

Replaces the shapes (the zones are kept).

Request body application/json

namestring
shapesobject[]required

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 PUT 'http://localhost:8080/api/room' \
  -H 'content-type: application/json' \
  -d '{
  "name": "Living room",
  "shapes": [
    {
      "type": "line",
      "name": "Desk strip",
      "count": 120,
      "dev": "d4k2x9",
      "pts": [
        [
          1.5,
          6
        ],
        [
          14.5,
          6
        ]
      ]
    }
  ]
}'
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