diff --git a/HISTORY.md b/HISTORY.md index c8102fe..159c424 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ ## version history +### 0.4.1 +- setting min value for co2 for investigating history gaps +- anti-crash-fix for netatmo's current API problems + ### 0.4.0 - added wind-sensor (still testing) diff --git a/accessory/eveatmo-room-accessory.js b/accessory/eveatmo-room-accessory.js index a285493..aac83c5 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); + // testing, because it seems, that low co2 values cause gaps in history + weatherData["co2"] = Math.max(450,weatherData["co2"]); + this.historyService.addEntry({ time: new Date().getTime() / 1000, temp: weatherData["currentTemperature"], diff --git a/accessory/eveatmo-weather-accessory.js b/accessory/eveatmo-weather-accessory.js index bbd5362..51e4fda 100644 --- a/accessory/eveatmo-weather-accessory.js +++ b/accessory/eveatmo-weather-accessory.js @@ -22,7 +22,7 @@ module.exports = function(pHomebridge) { if (!netatmoDevice.deviceData.hasOwnProperty(deviceId)) continue; var device = netatmoDevice.deviceData[deviceId]; - if(device.dashboard_data.Pressure) { + if(device.dashboard_data && device.dashboard_data.Pressure) { mainDeviceId = deviceId; } } diff --git a/package.json b/package.json index 57eb107..a6ba525 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-eveatmo", - "version": "0.4.0", + "version": "0.4.1", "description": "Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather", "license": "ISC", "keywords": [