Files
domo/docs/api/tests-api.md
2018-05-07 12:49:27 +02:00

247 lines
3.6 KiB
Markdown

# Test all the ubus API of domo.
## domo.capabilities
### list
```
./usr/bin/ubus call domo.capabilities list
```
```json
{
"capabilities": [
{
"name": "outlets",
"speech_name": "lumière"
},
{
"name": "shutters",
"speech_name": "volet"
},
{
"name": "sprinklers",
"speech_name": "station"
}
]
}
```
## domo.outlets
### create
```
./usr/bin/ubus call domo.outlets create "{\"name\":\"test\", \"sender\": 12797322, \"switch\": 4}"
```
#### create failed 1
Name is missing.
```
./usr/bin/ubus call domo.outlets create "{\"sender\": 12797322, \"switch\": 4}"
./usr/bin/ubus call domo.outlets create "{\"name\":\"test\", \"switch\": 4}"
./usr/bin/ubus call domo.outlets create "{\"name\":\"test\", \"sender\": 12797322}"
```
TODO
### list
```
./usr/bin/ubus call domo.outlets list
```
```json
{
"outlets": [
{
"id": 1,
"name": "Bureau JB",
"speech_name": "bureau",
"zone": "",
"state": true,
"sender": 12797322,
"switch": 0
},
{
"id": 2,
"name": "Salon",
"speech_name": "salon",
"zone": "",
"state": false,
"sender": 12797322,
"switch": 1
},
{
"id": 3,
"name": "Sapin",
"speech_name": "sapin",
"zone": "",
"state": false,
"sender": 12797322,
"switch": 2
}
]
}
```
### read
```
./usr/bin/ubus call domo.outlets read "{\"id\":2}"
```
```json
{
"id": 2,
"name": "Salon",
"speech_name": "salon",
"state": false,
"zone": "",
"sender": 12797322,
"switch": 1
}
```
### update
```
./usr/bin/ubus call domo.outlets update
```
TODO
### delete
```
./usr/bin/ubus call domo.outlets delete
```
TODO
## domo.sequences
### create
```
./usr/bin/ubus call domo.sequences create
```
### list
```
./usr/bin/ubus call domo.sequences list
```
### read
```
./usr/bin/ubus call domo.sequences read
```
### update
```
./usr/bin/ubus call domo.sequences update
```
### delete
```
./usr/bin/ubus call domo.sequences delete
```
## domo.shutters
### create
```
./usr/bin/ubus call domo.shutters create
```
### list
```
./usr/bin/ubus call domo.shutters list
```
### read
```
./usr/bin/ubus call domo.shutters read
```
### update
```
./usr/bin/ubus call domo.shutters update
```
### delete
```
./usr/bin/ubus call domo.shutters delete
```
### up
```
./usr/bin/ubus call domo.shutters up
```
### down
```
./usr/bin/ubus call domo.shutters down
```
## domo.sprinklers
### create
```
./usr/bin/ubus call domo.sprinklers create
```
### list
```
./usr/bin/ubus call domo.sprinklers list
```
### read
```
./usr/bin/ubus call domo.sprinklers read
```
### update
```
./usr/bin/ubus call domo.sprinklers update
```
### delete
```
./usr/bin/ubus call domo.sprinklers delete
```
### open
```
./usr/bin/ubus call domo.sprinklers open
```
### close
```
./usr/bin/ubus call domo.sprinklers close
```