mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-05-05 23:22:42 +00:00
Review comments
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.
|
// 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user