From 1027a2ffe77e453190d0bd8ebd4403ec4a37a7fd Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 <0xFEEDC0DE64@gmail.com> Date: Wed, 11 Apr 2018 19:58:42 +0200 Subject: [PATCH] Added script for amazon dash button --- amzn-dash-lamp.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 amzn-dash-lamp.js diff --git a/amzn-dash-lamp.js b/amzn-dash-lamp.js new file mode 100644 index 0000000..a4309c2 --- /dev/null +++ b/amzn-dash-lamp.js @@ -0,0 +1,15 @@ +const dash_button = require('node-dash-button'); +const http = require('http'); +const url = require('url'); + +dash_button('ac:63:be:07:f0:31', null, null, 'all').on('detected', function() { + console.log("omg found"); + http.request({ + host: '192.168.0.205', + port: 80, + path: '/toggle', + method: 'GET' + }).end(); +}); + +console.log('listening...');