mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-17 11:58:30 +00:00
Added Watch Battery transmission
Added a background service to send the watch battery level to Home Assistant. Changed the Glance View as requested by a user. Updated to new HA icon using SVG in stead of PNG.
This commit is contained in:
@ -24,12 +24,9 @@ using Toybox.Application.Properties;
|
||||
using Toybox.WatchUi;
|
||||
|
||||
class QuitTimer extends Timer.Timer {
|
||||
private var api_timeout;
|
||||
|
||||
|
||||
function initialize() {
|
||||
Timer.Timer.initialize();
|
||||
// Timer needs delay in milliseconds.
|
||||
api_timeout = (Properties.getValue("app_timeout") as Lang.Number) * 1000;
|
||||
}
|
||||
|
||||
function exitApp() as Void {
|
||||
@ -41,6 +38,7 @@ class QuitTimer extends Timer.Timer {
|
||||
}
|
||||
|
||||
function begin() {
|
||||
var api_timeout = Settings.get().getAppTimeout(); // ms
|
||||
if (api_timeout > 0) {
|
||||
start(method(:exitApp), api_timeout, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user