From 5bcafd84abe679b63f7f353c8cf3cfaf1363f848 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Sun, 27 May 2018 10:07:16 +0200 Subject: [PATCH 1/4] switched to default history handling (timer & length) --- accessory/eveatmo-room-accessory.js | 2 +- accessory/eveatmo-weather-accessory.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index dc2f359..f8d3429 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -66,7 +66,7 @@ module.exports = function(pHomebridge) { this.addService(serviceBattery); } - this.historyService = new FakeGatoHistoryService("room", this, {size: 40320, storage:'fs', disableTimer: true}); + this.historyService = new FakeGatoHistoryService("room", this, {storage:'fs'}); } catch (err) { this.log.warn("Could not process service files for " + accessoryConfig.name); diff --git a/accessory/eveatmo-weather-accessory.js b/accessory/eveatmo-weather-accessory.js index 45353a6..c99e01d 100644 --- a/accessory/eveatmo-weather-accessory.js +++ b/accessory/eveatmo-weather-accessory.js @@ -69,7 +69,7 @@ module.exports = function(pHomebridge) { this.addService(serviceBattery); } - this.historyService = new FakeGatoHistoryService("weather", this, {size: 40320, storage:'fs', disableTimer: true}); + this.historyService = new FakeGatoHistoryService("weather", this, {storage:'fs'}); } catch (err) { this.log.warn("Could not process service files for " + accessoryConfig.name); From 1b4cd52a0eae39046c42302363190627e985ae3e Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Sun, 27 May 2018 10:20:38 +0200 Subject: [PATCH 2/4] fixed problem where zero-measurement-values were not applied to characteristics --- accessory/eveatmo-rain-accessory.js | 4 ++-- accessory/eveatmo-room-accessory.js | 2 +- accessory/eveatmo-weather-accessory.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accessory/eveatmo-rain-accessory.js b/accessory/eveatmo-rain-accessory.js index e661730..3306483 100644 --- a/accessory/eveatmo-rain-accessory.js +++ b/accessory/eveatmo-rain-accessory.js @@ -63,10 +63,10 @@ module.exports = function(pHomebridge) { var result = {}; var dashboardData = accessoryData.dashboard_data; if (dashboardData) { - if (dashboardData.sum_rain_1) { + if (dashboardData.hasOwnProperty("sum_rain_1")) { result.rainLevelSum1 = Math.round(dashboardData.sum_rain_1 * 1000) / 1000; } - if (dashboardData.sum_rain_24) { + if (dashboardData.hasOwnProperty("sum_rain_24")) { result.rainLevelSum24 = Math.round(dashboardData.sum_rain_24 * 1000) / 1000; } } diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index f8d3429..ba2ca72 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -93,7 +93,7 @@ module.exports = function(pHomebridge) { var result = {}; var dashboardData = accessoryData.dashboard_data; if (dashboardData) { - if (dashboardData.Temperature) { + if (dashboardData.hasOwnProperty("Temperature")) { result.currentTemperature = dashboardData.Temperature; } if (dashboardData.CO2) { diff --git a/accessory/eveatmo-weather-accessory.js b/accessory/eveatmo-weather-accessory.js index c99e01d..afb4153 100644 --- a/accessory/eveatmo-weather-accessory.js +++ b/accessory/eveatmo-weather-accessory.js @@ -103,7 +103,7 @@ module.exports = function(pHomebridge) { var result = {}; var dashboardData = accessoryData.dashboard_data; if (dashboardData) { - if (dashboardData.Temperature) { + if (dashboardData.hasOwnProperty("Temperature")) { result.currentTemperature = dashboardData.Temperature; } if (dashboardData.Humidity) { From 0049cffac0a240c6191213b74f72720564f700b8 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Sun, 27 May 2018 10:29:15 +0200 Subject: [PATCH 3/4] updated readme + history, version-bump --- HISTORY.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 9c0f2c2..bfdb24b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ ## version history +### 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 + ### 0.3.5 - updated "low-battery"-handling and switched to different service-uuid for _Rain1H_ and _Rain24H_ diff --git a/package.json b/package.json index 5a47d4e..f526ac8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-eveatmo", - "version": "0.3.5", + "version": "0.3.6", "description": "Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather", "license": "ISC", "keywords": [ From 101b22c735e21042f1bd1f595195186dc52abd05 Mon Sep 17 00:00:00 2001 From: Sebastian Kroll Date: Mon, 28 May 2018 20:25:31 +0200 Subject: [PATCH 4/4] further fixes --- accessory/eveatmo-rain-accessory.js | 4 ++-- accessory/eveatmo-room-accessory.js | 2 +- accessory/eveatmo-weather-accessory.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accessory/eveatmo-rain-accessory.js b/accessory/eveatmo-rain-accessory.js index 3306483..57ca242 100644 --- a/accessory/eveatmo-rain-accessory.js +++ b/accessory/eveatmo-rain-accessory.js @@ -83,11 +83,11 @@ module.exports = function(pHomebridge) { applyWeatherData(weatherData) { var dataChanged = false; - if (weatherData.rainLevelSum1 && this.rainLevelSum1 != weatherData.rainLevelSum1) { + if (weatherData.hasOwnProperty("rainLevelSum1") && this.rainLevelSum1 != weatherData.rainLevelSum1) { this.rainLevelSum1 = weatherData.rainLevelSum1; dataChanged = true; } - if (weatherData.rainLevelSum24 && this.rainLevelSum24 != weatherData.rainLevelSum24) { + if (weatherData.hasOwnProperty("rainLevelSum24") && this.rainLevelSum24 != weatherData.rainLevelSum24) { this.rainLevelSum24 = weatherData.rainLevelSum24; dataChanged = true; } diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index ba2ca72..a285493 100644 --- a/accessory/eveatmo-room-accessory.js +++ b/accessory/eveatmo-room-accessory.js @@ -119,7 +119,7 @@ module.exports = function(pHomebridge) { applyWeatherData(weatherData) { var dataChanged = false; - if (weatherData.currentTemperature && this.currentTemperature != weatherData.currentTemperature) { + if (weatherData.hasOwnProperty("currentTemperature") && this.currentTemperature != weatherData.currentTemperature) { this.currentTemperature = weatherData.currentTemperature; dataChanged = true; } diff --git a/accessory/eveatmo-weather-accessory.js b/accessory/eveatmo-weather-accessory.js index afb4153..bbd5362 100644 --- a/accessory/eveatmo-weather-accessory.js +++ b/accessory/eveatmo-weather-accessory.js @@ -123,7 +123,7 @@ module.exports = function(pHomebridge) { applyWeatherData(weatherData) { var dataChanged = false; - if (weatherData.currentTemperature && this.currentTemperature != weatherData.currentTemperature) { + if (weatherData.hasOwnProperty("currentTemperature") && this.currentTemperature != weatherData.currentTemperature) { this.currentTemperature = weatherData.currentTemperature; dataChanged = true; }