mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-01 09:28:33 +00:00
Initial solution
This commit is contained in:
@ -36,6 +36,7 @@ class Settings {
|
||||
private static var mClearCache as Lang.Boolean = false;
|
||||
private static var mVibrate as Lang.Boolean = false;
|
||||
private static var mAppTimeout as Lang.Number = 0; // seconds
|
||||
private static var mPollDelay as Lang.Number = 0; // milliseconds
|
||||
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 mIsBatteryLevelEnabled as Lang.Boolean = false;
|
||||
@ -56,11 +57,18 @@ class Settings {
|
||||
mClearCache = Properties.getValue("clear_cache");
|
||||
mVibrate = Properties.getValue("enable_vibration");
|
||||
mAppTimeout = Properties.getValue("app_timeout");
|
||||
mPollDelay = Properties.getValue("poll_delay");
|
||||
mConfirmTimeout = Properties.getValue("confirm_timeout");
|
||||
mMenuAlignment = Properties.getValue("menu_alignment");
|
||||
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;
|
||||
}
|
||||
@ -138,6 +146,10 @@ class Settings {
|
||||
return mAppTimeout * 1000; // Convert to milliseconds
|
||||
}
|
||||
|
||||
static function getPollDelay() as Lang.Number {
|
||||
return mPollDelay;
|
||||
}
|
||||
|
||||
static function getConfirmTimeout() as Lang.Number {
|
||||
return mConfirmTimeout * 1000; // Convert to milliseconds
|
||||
}
|
||||
@ -153,4 +165,5 @@ class Settings {
|
||||
Background.deleteTemporalEvent();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user