Initial version with "auto quit"

Quit the application after a user settable period of time based on a timeout value from the settings.
This commit is contained in:
Philip Abbey
2023-12-02 19:04:53 +00:00
parent ea58171b2f
commit 8c0540ee45
9 changed files with 115 additions and 4 deletions

View File

@ -107,7 +107,23 @@ class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
Menu2InputDelegate.initialize();
}
function onBack() {
getApp().getQuitTimer().reset();
WatchUi.popView(WatchUi.SLIDE_RIGHT);
}
// Only for CheckboxMenu
function onDone() {
getApp().getQuitTimer().reset();
}
// Only for CustomMenu
function onFooter() {
getApp().getQuitTimer().reset();
}
function onSelect(item as WatchUi.MenuItem) as Void {
getApp().getQuitTimer().reset();
if (item instanceof HomeAssistantToggleMenuItem) {
var haToggleItem = item as HomeAssistantToggleMenuItem;
if (Globals.scDebug) {
@ -147,8 +163,9 @@ class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
}
}
function onBack() {
WatchUi.popView(WatchUi.SLIDE_RIGHT);
// Only for CustomMenu
function onTitle() {
getApp().getQuitTimer().reset();
}
}