Skip to content

Commit

Permalink
1.5.1
Browse files Browse the repository at this point in the history
Fix for invalid air quality index.
  • Loading branch information
RonnyWinkler committed Oct 3, 2023
1 parent eee044d commit cdfe2f2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "nu.baretta.openweathermap",
"version": "1.5.0",
"version": "1.5.1",
"compatibility": ">=8.1.1",
"sdk": 3,
"name": {
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion drivers/owmAirPollutionCurrent/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion drivers/owmAirPollutionHourly/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit cdfe2f2

Please sign in to comment.