smart-house-web: в работе

This commit is contained in:
8 changed files with 219 additions and 47 deletions

View File

@@ -4,11 +4,68 @@ GET http://localhost:8080/debug
### list rooms
GET http://localhost:8080/rooms
### add room
PUT http://localhost:8080/room
### post all rooms
POST http://localhost:8080/rooms
Content-Type: application/json
"ROOM"
{
"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