From 037b818c9490a9347f6c598c52e40f9f09e564a2 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Tue, 12 Jun 2018 17:33:33 +0200 Subject: [PATCH 1/3] no message --- accessory/eveatmo-room-accessory.js | 3 +++ lib/netatmo-device.js | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index a285493..fc4e4c5 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -79,6 +79,9 @@ module.exports = function(pHomebridge) { var accessoryData = this.extractAccessoryData(deviceData); var weatherData = this.mapAccessoryDataToWeatherData(accessoryData); + // necessary for eve?! + weatherData["co2"] = Math.max(400,weatherData["co2"]); + this.historyService.addEntry({ time: new Date().getTime() / 1000, temp: weatherData["currentTemperature"], diff --git a/lib/netatmo-device.js b/lib/netatmo-device.js index feef608..644c076 100644 --- a/lib/netatmo-device.js +++ b/lib/netatmo-device.js @@ -19,22 +19,16 @@ class NetatmoDevice { this.deviceData = null; this.accessories = []; - this.refreshCheckRunning = false; this.runCheckInterval = setInterval(function() { - if (!this.refreshCheckRunning) { - this.refreshCheckRunning = true; - this.log.debug("Executing Timed Refresh"); - - this.refreshDeviceData(function(err, data) { - if (this.accessories) { - this.accessories.forEach(function(accessory) { - accessory.notifyUpdate(data); - }.bind(this)); - } - this.refreshCheckRunning = false; - }.bind(this), true); - } + this.log.debug("Executing Timed Refresh"); + this.refreshDeviceData(function(err, data) { + if (this.accessories) { + this.accessories.forEach(function(accessory) { + accessory.notifyUpdate(data); + }.bind(this)); + } + }.bind(this), true); }.bind(this), ttl * 1000); } From 260c2bad9eca4ed5f07aa7695b519099b0a9af91 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Sat, 23 Jun 2018 20:01:37 +0200 Subject: [PATCH 2/3] reversed co2 minimum-limiting because it does not solve the problem --- accessory/eveatmo-room-accessory.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index fc4e4c5..a285493 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -79,9 +79,6 @@ module.exports = function(pHomebridge) { var accessoryData = this.extractAccessoryData(deviceData); var weatherData = this.mapAccessoryDataToWeatherData(accessoryData); - // necessary for eve?! - weatherData["co2"] = Math.max(400,weatherData["co2"]); - this.historyService.addEntry({ time: new Date().getTime() / 1000, temp: weatherData["currentTemperature"], From eb0f5859d00174ec3180280ba7d30cbcb49edc37 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Sat, 23 Jun 2018 20:05:19 +0200 Subject: [PATCH 3/3] version bump + history update --- HISTORY.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index bfdb24b..0337d8c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ ## version history +### 0.3.7 +- changed polling mechanism to prevent deadlocks on netatmo API errors + ### 0.3.6 - fixed bug were zero-measurement-values were not applied to characteristics (https://github.com/skrollme/homebridge-eveatmo/issues/15) - switched to default history length and timer-handling diff --git a/package.json b/package.json index f526ac8..2f566cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-eveatmo", - "version": "0.3.6", + "version": "0.3.7", "description": "Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather", "license": "ISC", "keywords": [