Skip to content

Conversation

@andriykorchak
Copy link

Hi @hrbonz

Thanks for this great library.

I've found a minor edge case issue. I currently handle it in the calling code, but it would be nice to take care of it in the library.

Currently If pollutant concentration is outside of the lookup table range iaqi() function will crash with IndexError.

This PR fixes it. If the concentration is lower or higher than the range defined in the look up table, the function will return lowest or highest AQI value from the table accordingly.

Please let me know what you think about these changes.

Thanks.

Andrii

e28eta added a commit to e28eta/pyportal-aqi that referenced this pull request Mar 25, 2021
hrbonz/python-aqi#22

This started happening to me. PurpleAir thinks there's a bug or debris in the sensor
I've chosen to display. 🤷‍♂️

Nothing I can do about the bad sensor, but this is greatly preferable to having the
project crash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant