From b0b10592cd915c816d0d365f05eb33a636963db2 Mon Sep 17 00:00:00 2001 From: notEvil Date: Thu, 6 Apr 2023 23:51:16 +0200 Subject: [PATCH 1/2] - apps/chargent: added notification --- apps/chargent/boot.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/chargent/boot.js b/apps/chargent/boot.js index c62003a21..666fd3a04 100644 --- a/apps/chargent/boot.js +++ b/apps/chargent/boot.js @@ -24,16 +24,17 @@ lim = sum / cnt; require('Storage').writeJSON('chargent.json', {limit: lim}); } + require('notify').show({id: 'chargent', title: 'Fully charged'}); // TODO ? customizable Bangle.buzz(500); setTimeout(() => Bangle.buzz(500), 1000); } - }, 30*1000); + }, 3e4); } } else { if (id) { - clearInterval(id); - id = undefined; + id = clearInterval(id); + require('notify').hide({id: 'chargent'}); } } }); From bbbbe4ed7655b27af41baba751e13c9de1224e78 Mon Sep 17 00:00:00 2001 From: notEvil Date: Fri, 7 Apr 2023 13:42:11 +0200 Subject: [PATCH 2/2] - apps/chargent: updated metadata --- apps/chargent/ChangeLog | 1 + apps/chargent/metadata.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/chargent/ChangeLog b/apps/chargent/ChangeLog index 3003cd07d..d7172c8d2 100644 --- a/apps/chargent/ChangeLog +++ b/apps/chargent/ChangeLog @@ -1,3 +1,4 @@ 0.01: First version 0.02: Support BangleJS2 0.03: Added threshold +0.04: Added notification diff --git a/apps/chargent/metadata.json b/apps/chargent/metadata.json index 653cb7d74..dda0369a6 100644 --- a/apps/chargent/metadata.json +++ b/apps/chargent/metadata.json @@ -1,11 +1,12 @@ { "id": "chargent", "name": "Charge Gently", - "version": "0.03", + "version": "0.04", "description": "When charging, reminds you to disconnect the watch to prolong battery life.", "icon": "icon.png", "type": "bootloader", "tags": "battery", "supports": ["BANGLEJS", "BANGLEJS2"], + "dependencies": {"notify": "type"}, "readme": "README.md", "storage": [ {"name": "chargent.boot.js", "url": "boot.js"}