GW-API: Commands
From Yombo
- Authentication
- Provided resources
See also | |
---|---|
Summary
The commands endpoint displays all commands that the gateway knows about. Note, not all devices can use the all commands.
Get all commands
Get a listing of all commands.
<div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-auth-key: kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB" \
http://localhost:8080/api/v1/command
<div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests
url = 'http://localhost:8080/api/v1/command'
headers = {
'x-auth-key': 'kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB',
}
response = requests.get(url, headers=headers)
<div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
{
"code": 200,
"message": "OK",
"payload": [
{
"command_id": "aWvzB0ENZ23JO",
"always_load": "1",
"voice_cmd": "on",
"cmd": "on",
"label": "On",
"machine_label": "on",
"description": "Sends an on command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "6qBJKkN6kw3nW",
"always_load": "1",
"voice_cmd": "off",
"cmd": "off",
"label": "Off",
"machine_label": "off",
"description": "Sends an off command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "4bxmNlRNlEXA2",
"always_load": "1",
"voice_cmd": "close",
"cmd": "close",
"label": "Close",
"machine_label": "close",
"description": "Sends a close command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "QaEAzkdQlRvV5",
"always_load": "1",
"voice_cmd": "open",
"cmd": "open",
"label": "Open",
"machine_label": "open",
"description": "Sends an open command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "adDnNk7WkLGrO",
"always_load": "1",
"voice_cmd": "dim",
"cmd": "dim",
"label": "Dim",
"machine_label": "dim",
"description": "Sends a dim command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "Rnpx5ZqYZbyzY",
"always_load": "1",
"voice_cmd": "brighten",
"cmd": "brighten",
"label": "Brighten",
"machine_label": "brighten",
"description": "Sends a brighten command",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
},
{
"command_id": "pvYA2Z4Rlje9m",
"always_load": "1",
"voice_cmd": "set brightness",
"cmd": "set_brightness",
"label": "Set Brightness",
"machine_label": "set_brightness",
"description": "Set brightness to a specified level. Include either 'set_percent' or 'set_level' with the command.",
"public": 2,
"status": 1,
"created_at": 1482065387,
"updated_at": 1482065387
}
]
}