Closed vkareh closed 9 months ago
Thank you for the PR. I don't like to have to restart the sim to get new data. Furthermore I can't test the 'no-data' case anymore.
Could you restructure the code such that it is bound to a key binding. Just as I've done for the heart rate measurements or even better the notifications? Maybe use 'w' key to cycle through the weather data and 'shift+w' to have 'no-weather-data' -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
@NeroBurner yes, that was my first iteration, but had issues refreshing the weather since the instance of weatherService in main.cpp
was different than the instance being used by the displayapp. I've finally solved it and now you can use w
for generating random weather and W
for clearing it.
Adding weather to the sim exposed a bug in the PTS face, where the value will always be considered dirty and attempt to display a formatted string even if the weather data is cleared. I've submitted a fix here: https://github.com/InfiniTimeOrg/InfiniTime/pull/1965
edit: This fix is now merged upstream
I also added forecast data now.
@NeroBurner
Please inform me if the extra code should stay in (and why). After that I'll happily merge :)
Absolutely! Thanks for the review. The extra code is just operator overrides to support the Forecast/Day structs. Without it, any screen that relies on DirtyValue
to display up-to-date Forecast data will make the sim build fail.
I currently added it to the InfiniTime SimpleWeatherService in https://github.com/InfiniTimeOrg/InfiniTime/pull/1995, but I can submit it as a separate PR to add just the overrides if you prefer.
I've submitted a patch for InfiniTime with only the operator overrides: https://github.com/InfiniTimeOrg/InfiniTime/pull/2011
That makes sense! Then yes please keep the operator overrides. They are indeed useful and I am positive they will find their way into InfiniTime eventually 😁
One VERY last thing. Please update the readme.md as well with the new key to show and clear weather data 🙇♂️
@NeroBurner
One VERY last thing. Please update the readme.md as well with the new key to show and clear weather data 🙇♂️
Done!
Merged! Thanks a lot!
Generates random weather and forecast data. Also adds a new simulation key handler for weather data:
Needed to build the sim for the weather app in https://github.com/InfiniTimeOrg/InfiniTime/pull/1995