using the host from the document.location
This commit is contained in:
parent
c9b90f2221
commit
a00d110f51
@ -10,6 +10,7 @@
|
||||
"atob": "^2.0.3",
|
||||
"babel-preset-es2015": "^6.14.0",
|
||||
"basic-authentication": "^1.7.0",
|
||||
"better-npm-run": "0.0.13",
|
||||
"body-parser": "^1.15.2",
|
||||
"btoa": "^1.1.2",
|
||||
"cfenv": "1.0.x",
|
||||
@ -36,8 +37,8 @@
|
||||
"sugar-date": "^2.0.2",
|
||||
"uuid-pure": "^1.0.10",
|
||||
"websocket": "^1.0.23",
|
||||
"ws": "^1.1.1",
|
||||
"better-npm-run": "0.0.13"
|
||||
"wemo-client": "^0.11.2",
|
||||
"ws": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"after": "^0.8.1",
|
||||
|
20
wemo.js
Normal file
20
wemo.js
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Created by martin on 1/7/17.
|
||||
*/
|
||||
var Wemo = require('wemo-client');
|
||||
var wemo = new Wemo();
|
||||
|
||||
wemo.discover(function(deviceInfo) {
|
||||
console.log('Wemo Device Found: %j', deviceInfo);
|
||||
|
||||
// Get the client for the found device
|
||||
var client = wemo.client(deviceInfo);
|
||||
|
||||
// Handle BinaryState events
|
||||
client.on('binaryState', function(value) {
|
||||
console.log('Binary State changed to: %s', value);
|
||||
});
|
||||
|
||||
// Turn the switch on
|
||||
client.setBinaryState(1);
|
||||
});
|
Loading…
Reference in New Issue
Block a user