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:
Philip Abbey
2023-12-31 15:22:21 +00:00
parent b2461a09e6
commit 56155f5f5c
96 changed files with 1152 additions and 260 deletions

View File

@ -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);
}