From c4a7ec7ae9945bcc479f6ba991f0774e142f2d35 Mon Sep 17 00:00:00 2001 From: Mark Hindess Date: Fri, 18 Jul 2014 10:28:57 +0100 Subject: [PATCH] Fix typo bugs. --- hardware/wemo/60-wemo.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hardware/wemo/60-wemo.js b/hardware/wemo/60-wemo.js index 3f75f8d2..57415ea2 100644 --- a/hardware/wemo/60-wemo.js +++ b/hardware/wemo/60-wemo.js @@ -40,16 +40,16 @@ module.exports = function(RED) { function WemoIn(n) { RED.nodes.createNode(this,n); this.ipaddr = n.ipaddr; - this.wemoSwitch = new WeMo(n.ipaddr); + this.wemoSwitch = new Wemo(n.ipaddr); this.wemoSwitch.state = 0; var node = this; var tick = setInterval(function() { - wemoSwitch.getBinaryState(function(err, result) { + node.wemoSwitch.getBinaryState(function(err, result) { if (err) { node.warn(err); } - if (parseInt(result) != wemoSwitch.state) { - wemoSwitch.state = parseInt(result); - node.send({payload:wemoSwitch.state,topic:"wemo/"+node.ipaddr}); + if (parseInt(result) != node.wemoSwitch.state) { + node.wemoSwitch.state = parseInt(result); + node.send({payload:node.wemoSwitch.state,topic:"wemo/"+node.ipaddr}); } }); }, 2000);