Skip to content

Commit

Permalink
Handle case where there is no AQI data
Browse files Browse the repository at this point in the history
  • Loading branch information
djjudas21 committed Dec 26, 2023
1 parent 75e722d commit dea51b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecowitt_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def logecowitt():
results[key] = value

# Add Air Quality Index (AQI)
if data['pm25_avg_24h_ch1']:
if data.get('pm25_avg_24h_ch1'):
if aqi_standard == 'uk':
results['aqi'] = aqi_uk(data['pm25_avg_24h_ch1'])
elif aqi_standard == 'epa':
Expand Down

0 comments on commit dea51b3

Please sign in to comment.