thstielow / raspi-bme680-iaq

Basic IAQ calculator for the Bosch bme680 sensor, compensating the humidity dependency and long-term drifts. Outputs a gas quality score on a range of 0-100%.
MIT License
43 stars 2 forks source link

getIAQ return 0 instead of None during sensor burn-in period #4

Open Met0o opened 1 year ago

Met0o commented 1 year ago

Hello Thomas,

I came across your IAQ calculation method and found it very well done, so I decided to use it in my project. My implementation involves Docker, InfluxDB, and Grafana.

I noticed a minor issue when the getIAQ method returns None during the sensor burn-in period. Due to the specifics of my implementation and that InfluxDB cannot handle NoneType values this results in errors.

To resolve this, I suggest modifying the getIAQ method to return a default value instead of None during the burn-in period. This could be a predefined value or simply setting the air quality score to 0 during the burn-in period (anything that's float or int). This change would make it easier to integrate your code with InfluxDB and other data storage solutions that might have issues handling NoneType values.

I hope you find this feedback helpful, and I appreciate the work you've put into creating this IAQ calculation.

Best regards,

Metodi