Skip to content

Commit

Permalink
fix issue #104, /blink1/{on,off} not working for multiple blink1 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Nov 21, 2018
1 parent 3a3f146 commit 7f76112
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/server/apiServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ app.get('/blink1(/id)?', function(req,res) {
});
});
app.get('/blink1/off', function(req,res) {
var blink1_id = Number(req.query.blink1_id);
PatternsService.stopAllPatterns();
Blink1Service.fadeToColor(0.1, '#000000', 0); // turn off everyone
Blink1Service.fadeToColor(0.1, '#000000', 0, blink1_id); // turn off everyone
res.json({
status: "blink1 off"
});
});
app.get('/blink1/on', function(req,res) {
var blink1_id = Number(req.query.blink1_id);
PatternsService.stopAllPatterns();
Blink1Service.fadeToColor(0.1, '#ffffff'); // turn off everyone
Blink1Service.fadeToColor(0.1, '#ffffff', 0, blink1_id); // turn off everyone
res.json({
status: "blink1 on"
});
Expand Down

0 comments on commit 7f76112

Please sign in to comment.