-
Notifications
You must be signed in to change notification settings - Fork 2
/
apiary.apib
73 lines (55 loc) · 1.87 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# RoPi Robot API
RoPi is a simple API allowing consumers to remotely control a Raspberry Pi Robot.
The RoPi project is hosted at https://github.com/ThumbGen/ropi
*THIS DOCUMENTATION IS WORK IN PROGRESS*
## Light sensors [/ropi/api/v1.0/lights]
### Get light sensors status [GET]
Returns the values of up to 4 light sensors
+ Response 200 (application/json)
{
"0": 1000,
"1": 1000,
"2": 1000,
"3": 1000
}
## Controlling LEDs [/ropi/api/v1.0/leds/{cmd}]
### Change LEDs status [PUT]
You may send status for all LEDs or individual ones. The request body must be provided only for the "set" command.
+ Parameters
+ cmd (required, string, `set`) ... Can be one of the following values:
* "set": specify the color for each led individually (see below for the required request body)
* "off": switch all LEDs off
* "brake": switch on the rear LEDs by using a red color
* "dimmed": switch on front and rear LEDs by using a white color
* "flash": switch on front LEDs for 1 second by using strong white color
* "forward": switch on front LEDs by using strong white color
+ Request (application/json)
[
{
"led": 0,
"red": 1000,
"green": 1000,
"blue": 1000,
},
{
"led": 1,
"red": 1000,
"green": 1000,
"blue": 1000,
},
{
"led": 2,
"red": 1000,
"green": 1000,
"blue": 1000,
},
{
"led": 3,
"red": 1000,
"green": 1000,
"blue": 1000,
}
]
+ Response 200 (application/json)