mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-07-11 23:38:38 +00:00
Added correctly formatted code comments
The newer SDK support tooltips to show the function prototype and help text, so best to make good use of it.
This commit is contained in:
@ -11,11 +11,6 @@
|
||||
//
|
||||
// J D Abbey & P A Abbey, 28 December 2022
|
||||
//
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// Quit the application after a period of inactivity in order to save the battery.
|
||||
//
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
||||
using Toybox.Lang;
|
||||
@ -23,18 +18,27 @@ using Toybox.Timer;
|
||||
using Toybox.Application.Properties;
|
||||
using Toybox.WatchUi;
|
||||
|
||||
//! Quit the application after a period of inactivity in order to save the battery.
|
||||
//!
|
||||
class QuitTimer extends Timer.Timer {
|
||||
|
||||
//! Class Constructor
|
||||
//
|
||||
function initialize() {
|
||||
Timer.Timer.initialize();
|
||||
}
|
||||
|
||||
//! Can't see how to make a method object from `System.exit()` without this layer of
|
||||
//! indirection. I assume this is because `System` is a static class.
|
||||
//
|
||||
function exitApp() as Void {
|
||||
// System.println("QuitTimer exitApp(): Exiting");
|
||||
// This will exit the system cleanly from any point within an app.
|
||||
System.exit();
|
||||
}
|
||||
|
||||
//! Kick off the quit timer.
|
||||
//
|
||||
function begin() {
|
||||
var api_timeout = Settings.getAppTimeout(); // ms
|
||||
if (api_timeout > 0) {
|
||||
@ -42,6 +46,8 @@ class QuitTimer extends Timer.Timer {
|
||||
}
|
||||
}
|
||||
|
||||
//! Reset the quit timer.
|
||||
//
|
||||
function reset() {
|
||||
// System.println("QuitTimer reset(): Restarted quit timer");
|
||||
stop();
|
||||
|
Reference in New Issue
Block a user