Skip to content

Fix missing digits // Better OTA // Improved WeatherPlugin#173

Open
yourdawi wants to merge 4 commits intoph1p:mainfrom
yourdawi:main
Open

Fix missing digits // Better OTA // Improved WeatherPlugin#173
yourdawi wants to merge 4 commits intoph1p:mainfrom
yourdawi:main

Conversation

@yourdawi
Copy link

@yourdawi yourdawi commented Oct 27, 2025

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.

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
@yourdawi yourdawi changed the title Removed Scren.loadFromStorage(); Fix missing digits // Removed Scren.loadFromStorage(); Oct 27, 2025
@yourdawi yourdawi changed the title Fix missing digits // Removed Scren.loadFromStorage(); Fix missing digits // Better OTA Oct 28, 2025
@yourdawi yourdawi changed the title Fix missing digits // Better OTA Fix missing digits // Better OTA // Improved WeatherPlugin Oct 28, 2025
Improved Messages per api depending on missing digit fix
Copy link
Contributor

@Solmath Solmath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +57 to +65
if (activeMessages.empty())
{
if (screenCached)
{
Screen.restoreCache();
screenCached = false;
}
currentStatus = NONE;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved to a function, because it is used twice (e.g. restoreScreenIfMessagesEmpty())

}
}

Screen.loadFromStorage();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +241 to +247
if (currentStatus == NONE || currentStatus == MESSAGES)
{
Scheduler.update();
// Only update scheduler when not showing messages
if (currentStatus == NONE)
{
Scheduler.update();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
  }
}

@yourdawi
Copy link
Author

yourdawi commented Nov 8, 2025

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.

The truth is, i do not know how to make multiple PRs, everything i pushed in my fork, was in this PR. :/

@mrueg
Copy link
Contributor

mrueg commented Dec 15, 2025

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.

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.
You can create multiple branches in git with git checkout -b my-new-branch.
Then you commit the desired changes towards that branch and push it to your fork in github. After that you can use that branch to create a PR for a specific feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants