Review comments

This commit is contained in:
Philip Abbey
2024-03-21 19:29:52 +00:00
parent 0a93f4f9ba
commit 2a99069f48
2 changed files with 6 additions and 6 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. // 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. // The chain of functions from 'updateNextMenuItem()' calls 'updateNextMenuItem()' on completion.
if (mItemsToUpdate.size() > 0) { if (mItemsToUpdate.size() > 0) {
updateNextMenuItemInt(); updateNextMenuItemInternal();
} }
} }
@ -397,21 +397,21 @@ class HomeAssistantApp extends Application.AppBase {
function updateNextMenuItem() as Void { function updateNextMenuItem() as Void {
var delay = Settings.getPollDelay(); var delay = Settings.getPollDelay();
if ((delay > 0) and (mNextItemToUpdate == 0)) { if ((delay > 0) and (mNextItemToUpdate == 0)) {
mUpdateTimer.start(method(:updateNextMenuItemInt), delay, false); mUpdateTimer.start(method(:updateNextMenuItemInternal), delay, false);
} else { } else {
updateNextMenuItemInt(); updateNextMenuItemInternal();
} }
} }
// We need to spread out the API calls so as not to overload the results queue and cause Communications.BLE_QUEUE_FULL // We need to spread out the API calls so as not to overload the results queue and cause Communications.BLE_QUEUE_FULL
// (-101) error. This function is called by a timer every Globals.menuItemUpdateInterval ms. // (-101) error. This function is called by a timer every Globals.menuItemUpdateInterval ms.
function updateNextMenuItemInt() as Void { function updateNextMenuItemInternal() as Void {
var itu = mItemsToUpdate as Lang.Array<HomeAssistantToggleMenuItem>; var itu = mItemsToUpdate as Lang.Array<HomeAssistantToggleMenuItem>;
if (itu != null) { if (itu != null) {
itu[mNextItemToUpdate].getState(); itu[mNextItemToUpdate].getState();
mNextItemToUpdate = (mNextItemToUpdate + 1) % itu.size(); mNextItemToUpdate = (mNextItemToUpdate + 1) % itu.size();
// } else { // } else {
// System.println("HomeAssistantApp updateNextMenuItemInt(): No menu items to update"); // System.println("HomeAssistantApp updateNextMenuItemInternal(): No menu items to update");
} }
} }

View File

@ -36,7 +36,7 @@ class Settings {
private static var mClearCache as Lang.Boolean = false; private static var mClearCache as Lang.Boolean = false;
private static var mVibrate as Lang.Boolean = false; private static var mVibrate as Lang.Boolean = false;
private static var mAppTimeout as Lang.Number = 0; // seconds private static var mAppTimeout as Lang.Number = 0; // seconds
private static var mPollDelay as Lang.Number = 0; // milliseconds private static var mPollDelay as Lang.Number = 0; // seconds
private static var mConfirmTimeout as Lang.Number = 3; // seconds private static var mConfirmTimeout as Lang.Number = 3; // seconds
private static var mMenuAlignment as Lang.Number = WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT; private static var mMenuAlignment as Lang.Number = WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT;
private static var mIsBatteryLevelEnabled as Lang.Boolean = false; private static var mIsBatteryLevelEnabled as Lang.Boolean = false;