-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
31 lines (23 loc) · 1.07 KB
/
README
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
/:light/:power
Type: GET
Payload: ":light" is the light to change ('green', 'yellow', 'red', or 'all')
":power" is one of three states
"on": Turns the light on
"off": Turns the light off
"just": Turns the light on and turns others off NOTE: Not available for 'all', nothing will happen.
If just is given, you may also set two GET paramters that will cycle the light:
frequency: How often to cycle off/on, in milliseconds. NOTE: Please don't set frequency lower than 25 millis!!
millis: How long to cycle it, in milliseconds.
Examples:
localhost:3000/red/on
Will turn the red light on
localhost:3000/green/just
Will turn red/yellow off and green on
localhost:3000/all/off
Will turn all lights off
localhost:3000/yellow/just?frequency=100&millis=1000
Will turn red/green off and cycle yellow on/off for 1 second every 100 milliseconds
localhost:3000/all/just?frequency=25&millis=5000
Nothing will happen because "just" is only available for the individual lights
localhost:3000/
Just returns a webpage that calls the on/off api with qwe and asd