Amended update method to entire rounds

A single larger delay is now inserted once between entire rounds of status updates,
This commit is contained in:
Philip Abbey
2024-03-21 09:15:47 +00:00
parent 00b071c132
commit a0fe746c1d
5 changed files with 10 additions and 17 deletions

View File

@ -261,7 +261,7 @@ class HomeAssistantApp extends Application.AppBase {
// Start the continuous update process that continues for as long as the application is running.
// The chain of functions from 'updateNextMenuItem()' calls 'updateNextMenuItem()' on completion.
if (mItemsToUpdate.size() > 0) {
updateNextMenuItem();
updateNextMenuItemInt();
}
}
@ -396,7 +396,7 @@ class HomeAssistantApp extends Application.AppBase {
function updateNextMenuItem() as Void {
var delay = Settings.getPollDelay();
if (delay >= 50) { // Minimum 50 ms delay for Timers
if ((delay > 0) and (mNextItemToUpdate == 0)) {
mUpdateTimer.start(method(:updateNextMenuItemInt), delay, false);
} else {
updateNextMenuItemInt();