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/accessory/eveatmo-rain-accessory.js b/accessory/eveatmo-rain-accessory.js index e661730..57ca242 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; } } @@ -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 dc2f359..a285493 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); @@ -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) { @@ -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 45353a6..bbd5362 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); @@ -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) { @@ -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; } 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": [