Files
domo-iot/docs/api/tests-ubus-api.md
NADAL Jean-Baptiste 8e7e94568f
All checks were successful
continuous-integration/drone/push Build is passing
Test outlet is now functional
2020-02-24 16:39:30 +01:00

3.6 KiB

Test all the ubus API of domo.

domo.capabilities

list

./usr/bin/ubus call domo.capabilities list
{
        "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}"

list

./usr/bin/ubus call domo.outlets list
{
        "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}"
{
        "id": 2,
        "name": "Salon",
        "speech_name": "salon",
        "state": false,
        "zone": "",
        "sender": 12797322,
        "switch": 1
}

update

./usr/bin/ubus call domo.outlets update "{\"id\": 4, \"name\":\"test1\", \"sender\": 1, \"switch\": 2}"

delete

./usr/bin/ubus call domo.outlets delete "{\"id\": 4}"

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