Added script for amazon dash button

This commit is contained in:
0xFEEDC0DE64
2018-04-11 19:58:42 +02:00
parent 118297e13f
commit 1027a2ffe7

15
amzn-dash-lamp.js Normal file
View File

@@ -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...');