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

@ -40,10 +40,10 @@ class HomeAssistantConfirmationDelegate extends WatchUi.ConfirmationDelegate {
function initialize(callback as Method() as Void) {
WatchUi.ConfirmationDelegate.initialize();
mConfirmMethod = callback;
var timeoutSeconds = Properties.getValue("confirm_timeout") as Lang.Number;
if (timeoutSeconds > 0) {
var timeout = Settings.get().getConfirmTimeout(); // ms
if (timeout > 0) {
mTimer = new Timer.Timer();
mTimer.start(method(:onTimeout), timeoutSeconds * 1000, true);
mTimer.start(method(:onTimeout), timeout, true);
}
}