mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-05-01 05:02:34 +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:
@ -240,7 +240,7 @@ You may choose to cache your menu definition on your device in order to reduce t
|
||||
|
||||
The application uses vibration to confirm the action has been requested, as opposed to the 'toast' appears to show the action has been successfully executed. This is enabled by default but may be turned off if you do not desire this behaviour.
|
||||
|
||||
The application timeout prevents the HomeAssistant App running on your watch when you have forgotten to close it. It prevents the refreshing of the menu statuses and therefore excessive wear on your battery level. For those users who prefer to keep the application open all the time for continuous use, they can reduce the battery wear by increasing the "poll delay". This inserts a user configurable number of milliseconds between each item's update check, hence reducing the API access activity. This also reduces the responsive of the statuses displayed when HA devices are switched externally, i.e. by another Home Assistant client, then the watch menu display will not update as quickly. Therefore if you only use the HomeAssistant App briefly now and then, keep this setting at the default 0 seconds. NB. There's a minimum of 50 ms in ConnectIQ timers, so anything less and the value here is forced to 0 ms which turns this feature off completely.
|
||||
The application timeout prevents the HomeAssistant App running on your watch when you have forgotten to close it. It prevents the refreshing of the menu statuses and therefore excessive wear on your battery level. For those users who prefer to keep the application open all the time for continuous use, they can reduce the battery wear by increasing the "poll delay". This inserts a user configurable number of seconds between each round of item update checks, hence reducing the API access activity. This also reduces the responsive of the statuses displayed when HA devices are switched externally, i.e. by another Home Assistant client, then the watch menu display will not update as quickly. Therefore if you only use the HomeAssistant App briefly now and then, keep this setting at the default 0 seconds. NB. To be clear, all items are updated then a configurable delay is inserted before the next round of all item updates.
|
||||
|
||||
There is a second timeout value for confirmation views. This is intended for use with more sensitive toggles so that the confirmation view is not left open and forgotten and then confirmed accidentally without you noticing. **We cannot advise you this is safe, be careful what you toggle with the watch application!**
|
||||
|
||||
|
@ -50,12 +50,11 @@
|
||||
<property id="app_timeout" type="number">0</property>
|
||||
|
||||
<!--
|
||||
Poll delay adds a user configurable delay (in milliseconds) to the status
|
||||
updates of each item in the watch menu that might be amended externally
|
||||
from the watch. A user has requested that it is possible to add this delay
|
||||
for an "always open" mode of operation, which then drains the watch battery
|
||||
from the additional API access activity. A Timer must have a minimum 50 ms
|
||||
value specified, so any value < 50 will be forced to 0.
|
||||
Poll delay adds a user configurable delay (in seconds) to each round of
|
||||
status updates of all item in the device's menu that might be amended
|
||||
externally from the watch. A user has requested that it is possible to add
|
||||
this delayfor an "always open" mode of operation, which then drains the
|
||||
watch battery from the additional API access activity.
|
||||
-->
|
||||
<property id="poll_delay" type="number">0</property>
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
<string id="SettingsClearCache">Should the application clear the existing cache next time it is started?</string>
|
||||
<string id="SettingsVibration">Should the application provide feedback via vibrations?</string>
|
||||
<string id="SettingsAppTimeout">Timeout in seconds. Exit the application after this period of inactivity to save the device battery.</string>
|
||||
<string id="SettingsPollDelay">Additional poll delay (in milliseconds). Adds a delay between the status update of menu items.</string>
|
||||
<string id="SettingsPollDelay">Additional poll delay (in seconds). Adds a delay between the status update of all menu items.</string>
|
||||
<string id="SettingsConfirmTimeout">After this time (in seconds), a confirmation dialog for an action is automatically closed and the action is cancelled. Set to 0 to disable the timeout.</string>
|
||||
<string id="SettingsTextAlign">Left (off) or Right (on) Menu Alignment.</string>
|
||||
<string id="LeftToRight">Left to right</string>
|
||||
|
@ -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