Last active
April 4, 2016 23:51
-
-
Save ayr-ton/8731331ea64583b0b3fc to your computer and use it in GitHub Desktop.
Blinking lights
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="usb", ATTR{idVendor}=="1130", ATTR{idProduct}=="0001", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="2c0d", ATTR{idProduct}=="0001", GROUP="plugdev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api = require 'simple-api' | |
blync = require 'blync' | |
device = blync.getDevice 0 | |
v0 = new api | |
prefix: ["api", "v0"] | |
host: "0.0.0.0" | |
port: "3333" | |
logLevel: 0 | |
v0.Controller "light", | |
options: {} | |
routes: | |
setState: | |
method: "GET" | |
path: ["*state"] | |
actions: | |
setState: (req, res, params) -> | |
device.setColor params.state | |
@responses.respond res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blync = require 'blync' | |
device = blync.getDevice 0 | |
process.argv.forEach (val, index, array) -> | |
if index == 2 | |
device.setColor val |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment