diff --git a/package.json b/package.json index 826d250..5de4ab1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tplink-taposmartplug", - "version": "1.0.1", + "version": "1.0.2", "api_version": "1.0", "keywords": [ "plug", diff --git a/src/index.js b/src/index.js index de2b572..9d6ad6c 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,7 @@ instance.prototype.PLUGINFO = { mac: '', hw_id: '', - hw_id: '', + fw_id: '', oem_id: '', on_time: '', @@ -129,6 +129,13 @@ instance.prototype.stopInterval = function () { } }; +instance.prototype.restartInterval = function() { + let self = this; + + self.status(self.STATUS_OK); + self.setupInterval(); +}; + instance.prototype.handleError = function(err) { let self = this; @@ -146,6 +153,7 @@ instance.prototype.handleError = function(err) { error = 'Unable to communicate with Device. Connection refused. Is this the right IP address? Is it still online?'; self.log('error', error); self.status(self.STATUS_ERROR); + setTimeout(self.restartInterval.bind(self), 30000); //restart interval after 30 seconds break; } } diff --git a/src/variables.js b/src/variables.js index 49ad8ef..94b70b7 100644 --- a/src/variables.js +++ b/src/variables.js @@ -51,7 +51,7 @@ module.exports = { self.setVariable('oem_id', self.PLUGINFO.oem_id); self.setVariable('on_time', self.PLUGINFO.on_time); - self.setVariable('overheated', (self.PLUGINFO.overheated == true ? 'On' : 'Off')); + self.setVariable('overheated', (self.PLUGINFO.overheated == true ? 'Yes' : 'No')); self.setVariable('nickname', self.PLUGINFO.nickname); self.setVariable('location', self.PLUGINFO.location);