1
0
Fork 0

#1132: Messages: Allow disabling repetition of buzzer

master
Jeroen Peters 2022-02-18 21:57:09 +01:00
parent a4c97850dd
commit d35481130a
2 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
{ {
"id": "messages", "id": "messages",
"name": "Messages", "name": "Messages",
"version": "0.22", "version": "0.21",
"description": "App to display notifications from iOS and Gadgetbridge", "description": "App to display notifications from iOS and Gadgetbridge",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",

View File

@ -8,11 +8,10 @@ draw:function() {
//if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute //if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute
let settings = require('Storage').readJSON("messages.settings.json", true) || {}; let settings = require('Storage').readJSON("messages.settings.json", true) || {};
if (settings.repeat===undefined) settings.repeat = 4; if (settings.repeat===undefined) settings.repeat = 4;
if(settings.repeat!==0) { if (settings.repeat===0) settings.repeat = (settings.unreadTimeout+1)*1000; // best way to no-repeat and keep next code
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) { if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
this.l = Date.now(); this.l = Date.now();
WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds
}
} }
setTimeout(()=>WIDGETS["messages"].draw(), 1000); setTimeout(()=>WIDGETS["messages"].draw(), 1000);
if (process.env.HWVERSION>1) Bangle.on('touch', this.touch); if (process.env.HWVERSION>1) Bangle.on('touch', this.touch);