sqfmi / Watchy

Watchy - An Open Source E-Ink Smartwatch
http://www.sqfmi.com
MIT License
1.83k stars 319 forks source link

Reset weather counter on Wifi connection #209

Closed aminch closed 1 year ago

aminch commented 1 year ago

Fix to make sure after connecting to a Wifi point that the next call to getWeatherData will actually attempt to connect to the API endpoint.

Currently the weatherIntervalCounter will increment every time getWeatherData is called, WiFi connected or not. So without this fix if getWeatherData is called, after connecting to a new WiFi it will skip calling the API until the WEATHER_UPDATE_INTERVAL (30 minutes by default) has passed. This leads to a delay in the first display of weather data.

Please let me know if you need some more details.

sqfmi commented 1 year ago

This is great, thanks!