Fix missing digits // Better OTA // Improved WeatherPlugin#173
Fix missing digits // Better OTA // Improved WeatherPlugin#173
Conversation
I removed Screen.loadFromStorage() out of Messages_::scroll() because persist() already saves the state. And the loop of the Plugin renders it with the next iteration again. Fixed missing digits in Clock
Improved Messages per api depending on missing digit fix
Solmath
left a comment
There was a problem hiding this comment.
Hi @yourdawi,
thanks a lot for the contribution! I just implemented the changes to message handling in my develop branch and would like to provide some feedback (see other comments).
One small suggestion for future PRs: Since this contains three independent changes, it might be helpful to split them into separate PRs. This can make it easier for maintainers to review and merge changes independently, but of course that's up to you and the maintainers' preferences.
Thanks again, and @HennieLP might also find this interesting.
Cheers
| if (activeMessages.empty()) | ||
| { | ||
| if (screenCached) | ||
| { | ||
| Screen.restoreCache(); | ||
| screenCached = false; | ||
| } | ||
| currentStatus = NONE; | ||
| } |
There was a problem hiding this comment.
This could be moved to a function, because it is used twice (e.g. restoreScreenIfMessagesEmpty())
| } | ||
| } | ||
|
|
||
| Screen.loadFromStorage(); |
There was a problem hiding this comment.
If loadFromStorage is removed in favor of using the cache, will persist() still be necessary?
As far as I understand persist() will save the screen content to non-volatile memory, while the cache lives in the RAM. The only other location where perist() is used is the DrawPlugin.
I'm a bit confused.
There was a problem hiding this comment.
It would be possible to remove persist(), its needed for saving to flash (brightness, renderBuffer_, rotation).
With only cacheCurrent() and restoreCache(), it would be gone after a restart, What is mostly needed for Draw i think.
| if (currentStatus == NONE || currentStatus == MESSAGES) | ||
| { | ||
| Scheduler.update(); | ||
| // Only update scheduler when not showing messages | ||
| if (currentStatus == NONE) | ||
| { | ||
| Scheduler.update(); | ||
| } |
There was a problem hiding this comment.
I wrote it like this to have fewer nested conditions:
if (currentStatus == NONE)
{
Scheduler.update();
}
if (currentStatus == NONE || currentStatus == MESSAGES)
{
if ((taskCounter % 4) == 0)
{
Messages.scrollMessageEveryMinute();
}
}
The truth is, i do not know how to make multiple PRs, everything i pushed in my fork, was in this PR. :/ |
Git has the concept of branches. The main one usually has the name main or before that master. |
I removed Screen.loadFromStorage() out of Messages_::scroll() because persist() already saves the state. And the loop of the Plugin renders it with the next iteration again.
Fixed missing digits in Clock #154
OTA was not working for me, changed a bit to make it work perfectly.
I run into some issues with the WeatherPlugin (not loading, crashing esp) so i made some improvements.