72 lines
1.2 KiB
HTTP
72 lines
1.2 KiB
HTTP
### DEBUG
|
|
GET http://localhost:8080/debug
|
|
|
|
### list rooms
|
|
GET http://localhost:8080/rooms
|
|
|
|
### post all rooms
|
|
POST http://localhost:8080/rooms
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"ROOM0": {
|
|
"devices": {}
|
|
},
|
|
"ROOM1": {
|
|
"devices": {
|
|
"therm": {
|
|
"type": "Thermometer",
|
|
"temperature": 22
|
|
},
|
|
"psock": {
|
|
"type": "PowerSocket",
|
|
"power_rate": 11,
|
|
"on": false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
### drop room
|
|
DELETE http://localhost:8080/room/ROOM
|
|
|
|
### add room
|
|
PUT http://localhost:8080/room/ROOM
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"devices": {
|
|
"therm": {
|
|
"type": "Thermometer",
|
|
"temperature": 20
|
|
},
|
|
"psock": {
|
|
"type": "PowerSocket",
|
|
"power_rate": 10,
|
|
"on": true
|
|
}
|
|
}
|
|
}
|
|
|
|
### get room
|
|
GET http://localhost:8080/room/ROOM1
|
|
|
|
### get room devices
|
|
GET http://localhost:8080/room/ROOM1/devices
|
|
|
|
### get room device
|
|
GET http://localhost:8080/room/ROOM/device/TEST
|
|
|
|
### get room device
|
|
PUT http://localhost:8080/room/ROOM/device/TEST
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"type": "PowerSocket",
|
|
"power_rate": 5,
|
|
"on": true
|
|
}
|
|
|
|
### get room device
|
|
DELETE http://localhost:8080/room/ROOM/device/TEST
|