tag HRM power requests to allow this to work alongside other widgets/apps (fix #799)

pull/803/head
Gordon Williams 2021-09-13 09:57:46 +01:00
parent 531fc6e186
commit 9f68a24315
9 changed files with 24 additions and 20 deletions

View File

@ -153,7 +153,7 @@
{ "id": "gbridge",
"name": "Gadgetbridge",
"icon": "app.png",
"version":"0.23",
"version":"0.24",
"description": "The default notification handler for Gadgetbridge notifications from Android",
"tags": "tool,system,android,widget",
"readme": "README.md",
@ -532,7 +532,7 @@
{ "id": "heart",
"name": "Heart Rate Recorder",
"icon": "app.png",
"version":"0.05",
"version":"0.06",
"interface": "interface.html",
"description": "Application that allows you to record your heart rate. Can run in background",
"tags": "tool,health,widget",
@ -721,7 +721,7 @@
{ "id": "widhrm",
"name": "Simple Heart Rate widget",
"icon": "widget.png",
"version":"0.03",
"version":"0.04",
"description": "When the screen is on, the widget turns on the heart rate monitor and displays the current heart rate (or last known in grey). For this to work well you'll need at least a 15 second LCD Timeout.",
"tags": "health,widget",
"type": "widget",
@ -1287,7 +1287,7 @@
{ "id": "wohrm",
"name": "Workout HRM",
"icon": "app.png",
"version":"0.07",
"version":"0.08",
"readme": "README.md",
"description": "Workout heart rate monitor notifies you with a buzz if your heart rate goes above or below the set limits.",
"tags": "hrm,workout",
@ -1466,7 +1466,7 @@
"id": "balltastic",
"name": "Balltastic",
"icon": "app.png",
"version": "0.01",
"version": "0.02",
"description": "Simple but fun ball eats dots game.",
"tags": "game,fun",
"type": "app",
@ -1895,7 +1895,7 @@
{ "id": "ballmaze",
"name": "Ball Maze",
"icon": "icon.png",
"version": "0.01",
"version": "0.02",
"description": "Navigate a ball through a maze by tilting your watch.",
"readme": "README.md",
"tags": "game",

View File

@ -23,3 +23,4 @@
0.21: Fix HRM setting
0.22: Respect Quiet Mode
0.23: Allow notification dismiss to remove from phone too
0.24: tag HRM power requests to allow this ot work alongside other widgets/apps (fix #799)

View File

@ -128,7 +128,7 @@
if (activityInterval)
clearInterval(activityInterval);
activityInterval = undefined;
if (s.hrm) Bangle.setHRMPower(1);
if (s.hrm) Bangle.setHRMPower(1,"gbr");
if (s.hrm) {
if (realtime) {
// if realtime reporting, leave HRM on and use that to trigger events
@ -138,7 +138,7 @@
hrmTimeout = 5;
activityInterval = setInterval(function() {
hrmTimeout = 5;
Bangle.setHRMPower(1);
Bangle.setHRMPower(1,"gbr");
}, interval*1000);
}
} else {
@ -281,7 +281,7 @@
if (hrmTimeout!==undefined) hrmTimeout--;
if (ok || hrmTimeout<=0) {
if (hrmTimeout!==undefined)
Bangle.setHRMPower(0);
Bangle.setHRMPower(0,"gbr");
sendActivity(hrm.confidence>20 ? hrm.bpm : -1);
}
});

View File

@ -11,3 +11,4 @@
Reduce memory usage by ~30%
Generate scale based on defined minimum and maximum measurement
Added background line on 50% to ease estimation of drawn values
0.06: tag HRM power requests to allow this ot work alongside other widgets/apps (fix #799)

View File

@ -31,12 +31,12 @@
if (settings.isRecording) {
WIDGETS["heart"].width = 24;
Bangle.on('HRM',onHRM);
Bangle.setHRMPower(1);
Bangle.setHRMPower(1,"heart");
var n = settings.fileNbr.toString(36);
recFile = require("Storage").open(".heart"+n,"a");
} else {
WIDGETS["heart"].width = 0;
Bangle.setHRMPower(0);
Bangle.setHRMPower(0,"heart");
recFile = undefined;
}
}

View File

@ -1,3 +1,4 @@
0.01: New Widget!
0.02: Tweaks for variable size widget system
0.03: Ensure redrawing works with variable size widget system
0.04: tag HRM power requests to allow this ot work alongside other widgets/apps (fix #799)

View File

@ -26,12 +26,12 @@
// redraw when the LCD turns on
Bangle.on('lcdPower', function(on) {
if (on) {
Bangle.setHRMPower(1);
Bangle.setHRMPower(1,"widhrm");
firstBPM = true;
currentBPM = undefined;
WIDGETS["hrm"].draw();
} else {
Bangle.setHRMPower(0);
Bangle.setHRMPower(0,"widhrm");
}
});
@ -44,7 +44,7 @@
}
WIDGETS["hrm"].draw();
});
Bangle.setHRMPower(Bangle.isLCDOn());
Bangle.setHRMPower(Bangle.isLCDOn(),"widhrm");
// add your widget
WIDGETS["hrm"]={area:"tl",width:24,draw:draw};

View File

@ -5,3 +5,4 @@
0.05: Improved buzz timing and rendering
0.06: Removed debug outputs, fixed rendering for upper limit, improved rendering for +/- icons, changelog version order fixed
0.07: Home button fixed and README added
0.08: tag HRM power requests to allow this ot work alongside other widgets/apps (fix #799)

View File

@ -288,7 +288,7 @@ function resetHighlightTimeout() {
}
function switchOffApp(){
Bangle.setHRMPower(0);
Bangle.setHRMPower(0,"wohrm");
Bangle.showLauncher();
}
@ -306,7 +306,7 @@ Bangle.on('lcdPower', (on) => {
}
});
Bangle.setHRMPower(1);
Bangle.setHRMPower(1,"wohrm");
Bangle.on('HRM', onHrm);
setWatch(incrementLimit, BTN1, {edge:"rising", debounce:50, repeat:true});