diff --git a/.homeychangelog.json b/.homeychangelog.json index 9a14e1c..2d0d4cf 100644 --- a/.homeychangelog.json +++ b/.homeychangelog.json @@ -254,5 +254,9 @@ "1.5.0": { "en": "Added OneCall API device for historical daily summary. Added instructions to pair view.", "de": "OneCall API Gerät für historische tägliche Zusammenfassung ergänzt. Anleitung für Greät-Hinzufügen-Dialog ergänzt" + }, + "1.5.1": { + "en": "Fix for invalid air quality index.", + "de": "Korrektur für ungültigen Luftqqalitäts-Index." } } diff --git a/.homeycompose/app.json b/.homeycompose/app.json index 2810384..ef61070 100644 --- a/.homeycompose/app.json +++ b/.homeycompose/app.json @@ -1,6 +1,6 @@ { "id": "nu.baretta.openweathermap", - "version": "1.5.0", + "version": "1.5.1", "compatibility": ">=8.1.1", "sdk": 3, "name": { diff --git a/app.json b/app.json index a38061d..65025f1 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "_comment": "This file is generated. Please edit .homeycompose/app.json instead.", "id": "nu.baretta.openweathermap", - "version": "1.5.0", + "version": "1.5.1", "compatibility": ">=8.1.1", "sdk": 3, "name": { diff --git a/drivers/owmAirPollutionCurrent/device.js b/drivers/owmAirPollutionCurrent/device.js index 9e3ebb2..9233e43 100644 --- a/drivers/owmAirPollutionCurrent/device.js +++ b/drivers/owmAirPollutionCurrent/device.js @@ -227,7 +227,12 @@ class owmAirPollutionCurrent extends Homey.Device { this.getDataCapability('measure_ap_so2')['value'] = data.list[0].components.so2; this.getDataCapability('measure_ap_nh3')['value'] = data.list[0].components.nh3; this.getDataCapability('measure_ap_aqi')['value'] = data.list[0].main.aqi.toString(); - this.getDataCapability('measure_ap_aqi_nr')['value'] = data.list[0].main.aqi; + if (data.list[0].main.aqi < 1 || data.list[0].main.aqi > 5){ + this.getDataCapability('measure_ap_aqi_nr')['value'] = undefined; + } + else{ + this.getDataCapability('measure_ap_aqi_nr')['value'] = data.list[0].main.aqi; + } // CAPABILITIES: Compare values and update changed capabilities. // TRIGGER: Compare values to start trigger after capability update. diff --git a/drivers/owmAirPollutionHourly/device.js b/drivers/owmAirPollutionHourly/device.js index c379e79..aee5ba4 100644 --- a/drivers/owmAirPollutionHourly/device.js +++ b/drivers/owmAirPollutionHourly/device.js @@ -153,7 +153,12 @@ class owmAirPollutionHourly extends Homey.Device { this.getDataCapability('measure_ap_so2')['value'] = data.components.so2; this.getDataCapability('measure_ap_nh3')['value'] = data.components.nh3; this.getDataCapability('measure_ap_aqi')['value'] = data.main.aqi.toString(); - this.getDataCapability('measure_ap_aqi_nr')['value'] = data.main.aqi; + if (data.main.aqi < 1 || data.main.aqi > 5){ + this.getDataCapability('measure_ap_aqi_nr')['value'] = undefined; + } + else{ + this.getDataCapability('measure_ap_aqi_nr')['value'] = data.main.aqi; + } // CAPABILITIES: Compare values and update changed capabilities. // TRIGGER: Compare values to start trigger after capability update.