mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-16 11:28:40 +00:00
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:
@ -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();
|
||||
|
@ -63,12 +63,6 @@ class Settings {
|
||||
mIsBatteryLevelEnabled = Properties.getValue("enable_battery_level");
|
||||
mBatteryRefreshRate = Properties.getValue("battery_level_refresh_rate");
|
||||
|
||||
// There's a minimum of 50 ms on Timer.Timers, so reset to 0 if too small.
|
||||
if (mPollDelay < 50) { // milliseconds
|
||||
mPollDelay = 0;
|
||||
Properties.setValue("poll_delay", mPollDelay);
|
||||
}
|
||||
|
||||
if (System has :ServiceDelegate) {
|
||||
mHasService = true;
|
||||
}
|
||||
@ -147,7 +141,7 @@ class Settings {
|
||||
}
|
||||
|
||||
static function getPollDelay() as Lang.Number {
|
||||
return mPollDelay;
|
||||
return mPollDelay * 1000; // Convert to milliseconds
|
||||
}
|
||||
|
||||
static function getConfirmTimeout() as Lang.Number {
|
||||
|
Reference in New Issue
Block a user