1
0
Fork 0

bthrm - Correctly handle 0 values

master
Martin Boonk 2022-12-02 23:53:32 +01:00
parent ddbbef2bf8
commit 8016e8ec53
3 changed files with 4 additions and 3 deletions

View File

@ -93,11 +93,11 @@ function draw(){
if (bt && bt.time > (now - VALUE_TIMEOUT)) {
layout.bt.label = bt.bpm;
if (bt.battery) layout.btBattery.label = bt.battery;
if (!isNaN(bt.battery)) layout.btBattery.label = bt.battery + "%";
if (bt.rr) layout.btRR.label = bt.rr.join(",");
if (bt.location) layout.btLocation.label = BODY_LOCS[bt.location];
if (!isNaN(bt.location)) layout.btLocation.label = BODY_LOCS[bt.location];
if (bt.contact !== undefined) layout.btContact.label = bt.contact ? "Yes":"No";
if (bt.energy) layout.btEnergy.label = bt.energy.toFixed(0) + "kJ";
if (!isNaN(bt.energy)) layout.btEnergy.label = bt.energy.toFixed(0) + "kJ";
} else {
layout.bt.label = "--";
layout.btBattery.label = "--";

View File

@ -5,6 +5,7 @@
"version": "0.17",
"description": "Overrides Bangle.js's build in heart rate monitor with an external Bluetooth one.",
"icon": "app.png",
"screenshots": [{"url":"screen.png"}],
"type": "app",
"tags": "health,bluetooth,hrm,bthrm",
"supports": ["BANGLEJS","BANGLEJS2"],

BIN
apps/bthrm/screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB