MallocArray / airgradient_esphome

ESPHome definition for an AirGradient DIY device to send data to HomeAssistant and AirGradient servers
GNU General Public License v3.0
215 stars 31 forks source link

NowCast reading doesn't change over to ready when countdown reaches zero #61

Open ex-nerd opened 2 months ago

ex-nerd commented 2 months ago

There appears to still be an issue with the NowCast (and probably AQI) calculations not showing data even when the calculation reaches zero. This looks like a rounding error or order of operations issue within the internal async loop because it does seem to clear up within an hour of reaching zero.

I'll try to find some time this weekend to poke at the code and find out what's going on, and submit a PR. Hopefully it just needs something to trigger the calculations as soon as the timer reacher zero so it doesn't leave the user confused why the countdown stays at zero for an hour.

MallocArray commented 2 months ago

Thanks. I'll keep an eye out for a PR.

If an order of operations, I wonder if changing the 1h interval that starts the scripts should be changed to something like 61 minutes so they don't overlap much. It would drift more over time, but might be something to consider.