Closed Docano closed 2 years ago
Very minor tweak. In the following snippet, I think the intention is to average the pm2.5 readings from each of the 2 sensors in the json file (since the purpleair sensors have 2 sensors onboard and averages them).
pm2a = float(data['results'][0]['PM2_5Value']) pm2b = float(data['results'][0]['PM2_5Value']) pm2 = (pm2a + pm2b) / 2
should be corrected to
pm2a = float(data['results'][0]['PM2_5Value']) pm2b = float(data['results'][1]['PM2_5Value']) pm2 = (pm2a + pm2b) / 2
The 2nd sensor is found at data['results'][0]
Good catch! Let me fix that real quick.
Very minor tweak. In the following snippet, I think the intention is to average the pm2.5 readings from each of the 2 sensors in the json file (since the purpleair sensors have 2 sensors onboard and averages them).
should be corrected to
The 2nd sensor is found at data['results'][0]