var wemo = require('wemo-js'); var http = require('http'); var util = require('util'); var xml2js = require('xml2js'); var postbodyheader = [ '', '', ''].join('\n'); var postbodyfooter = ['', '' ].join('\n'); var getenddevs = {}; getenddevs.path = '/upnp/control/bridge1'; getenddevs.action = '"urn:Belkin:service:bridge:1#GetEndDevices"'; getenddevs.body = [ postbodyheader, '', '%s', 'PAIRED_LIST', '', postbodyfooter ].join('\n'); if (process.argv.length < 3) { console.log("Help:"); console.log("node wemo-lights.js list - Shows all the available bulbs"); console.log("node wemo-lights.js state - Shows the current state of a given bulb"); console.log("node wemo-lights.js control on|off [0-255] - (dim value only used if state is on)"); console.log("node wemo-lights.js dim <0-255> - setting dim value of an off device will turn it on at new level"); console.log("node wemo-lights.js sleep