Closed Bursucel closed 2 months ago
I just added to the latest version of code.py
you can download it and copy to your board. Thanks for the suggestion.
Let me know if you run into any issues.
It looks like a merge conflict got committed:
def pmdata_aqi():
"""
Get AQI information based on average values
"""
<<<<<<< HEAD
value = USAQI.pm25_aqi(average_values(avgDict)['pm25 env'])
value = USAQI.aqi_info(value)
return value
=======
aqi = USAQI.pm25_aqi(average_values(avgDict)['pm25 env'])
aqi = USAQI.aqi_info(aqi)
return aqi
>>>>>>> 9636e2a3af18ddd94d9607d47c4bb861f79a2eba
and in the main loop:
while True:
# Take the measurements after every interval
if (clock + INTERVAL) < time.monotonic():
mqtt_msg = {}
mqtt_msg = read_all()
# averrage to smooth out values
avgDict = average_dict(mqtt_msg)
mqtt_msg = average_values(avgDict)
<<<<<<< HEAD
aqi = pmdata_aqi()
=======
aqi_data = {'aqi': pmdata_aqi()}
>>>>>>> 9636e2a3af18ddd94d9607d47c4bb861f79a2eba
Aaaargh, fixed it!
Closing as addressed
I was able to add the particles values but I cannot get the json data to show AQI value . Any idea what it should be ? Thanks.