diff --git a/hardware/wemo/lib/wemo.js b/hardware/wemo/lib/wemo.js index f2d1eb7b..2e8d6f9b 100644 --- a/hardware/wemo/lib/wemo.js +++ b/hardware/wemo/lib/wemo.js @@ -291,6 +291,11 @@ WeMoNG.prototype.toggleSocket = function toggleSocket(socket, on) { console.log("%j", postoptions); }); + post_request.on('timeout', function (e) { + console.log(e); + console.log("%j"); + }); + var body = [ postbodyheader, '', @@ -404,6 +409,12 @@ WeMoNG.prototype.getLightStatus = function getLightStatus(light) { def.reject(); }); + post_request.on('timeout', function (e) { + console.log(e); + console.log("%j"); + def.reject(); + }); + post_request.write(util.format(getDevStatus.body, light.id)); post_request.end(); @@ -440,6 +451,11 @@ WeMoNG.prototype.setStatus = function setStatus(light, capability, value) { console.log("%j", postoptions); }); + post_request.on('timeout', function (e) { + console.log(e); + console.log("%j"); + }); + //console.log(util.format(setdevstatus.body, light.id, capability, value)); post_request.write(util.format(setdevstatus.body, light.type === 'light'?'NO':'YES',light.id, capability, value)); diff --git a/hardware/wemo/package.json b/hardware/wemo/package.json index c9c0c425..fd668081 100644 --- a/hardware/wemo/package.json +++ b/hardware/wemo/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-wemo", - "version": "0.1.15", + "version": "0.1.16", "description": "Input and Output nodes for Belkin WeMo devices", "repository": "https://github.com/node-red/node-red-nodes/tree/master/hardware", "main": "WeMoNG.js",