Since we delivered the new weather 🌤️ feature...

Since we delivered the new weather 🌤️ feature in , some users noticed that their would crash after a few hours.

We figured that those crashes were caused by a memory overflow : InfiniTime stores too many weather events in memory!

github.com/InfiniTimeOrg/Infin

Let's fix this!

Improve weather service by faxe1008 · Pull Request #1822 · InfiniTimeOrg/InfiniTime

I wanted to investigate this issue: #1788 I found some things that could be refactored, and also some issues with the current implementation: Already expired events are added to the timeline and d...

GitHub

But first, let's enable C++17, we'll need a few functionalities from newer C++ (like "if constexpr")!

Coming from a company that is stuck (for various reasons) in C++11, this is probably one of the most satisfying commit ever!

Then let's refactor and improve the weather service : create weather events in dedicated functions and write a function (and multiple specializations) to handle the QCBOR deserialization.

Now, since actually uses only temperature, cloud and precipitation information, let's disable all the other weather events. This way, won't spend time and memory processing useless data.

Since we'll probably want to use those info later on, I don't want to delete the code that handles those events. I think this is a good opportunity to disable the code using "if constexpr".

Even if companion apps send multiple "versions" of the same event (ex : temperature for the next 6h and 24h), currently use only one of them. So... there's no need to store multiple version. The next step consists in choosing which event to add in the timeline, and to remove events that are overwritten by newer ones.

And finally, fix PineTimeStyle (PTS) so that it refreshes the weather info even if it didn't receive any precipitation info (and assume 0 precipitation in this case).

Ok! Now, time to push, create a PR and wait for the reviews !

github.com/InfiniTimeOrg/Infin

Weather service improvements and improve memory usage by JF002 · Pull Request #1860 · InfiniTimeOrg/InfiniTime

This branch implements the suggestion I did in this comment in #1822: Disable all weather events that are not processed by InfiniTime Ensure that a single version of each event is stored in memory...

GitHub

Ooh and this PR frees 1596B in flash memory! Nice!