Skip to content

Instantly share code, notes, and snippets.

@prestonp
Created July 15, 2016 04:12
Show Gist options
  • Save prestonp/e4553ccc3fc5fee0a517ad250f04f0bf to your computer and use it in GitHub Desktop.
Save prestonp/e4553ccc3fc5fee0a517ad250f04f0bf to your computer and use it in GitHub Desktop.
dash button -> gotem
var get = require('simple-get');
var snuggle = 'a0:02:dc:23:50:30';
var dash_button = require('node-dash-button');
var dash = dash_button(snuggle);
var hornURL = 'http://got-em.mybluemix.net/sounds/horn?room=stacktheplanet';
dash.on("detected", function (){
get(hornURL, (err, res) => {
if (err) return console.log(err);
console.log(new Date().toLocaleString() + ' - triggered horn');
});
});
console.log('listening for buttons');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment