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/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'}); } } }); 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"}