From 1a356a033baca1ad429dd567415c1d44d73eb12b Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Fri, 18 Mar 2022 09:52:53 -0500 Subject: [PATCH 1/5] Special reservoir handling for both Eros and DASH --- lib/plugins/pump.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index 8a0d397a300..2d53d50e751 100644 --- a/lib/plugins/pump.js +++ b/lib/plugins/pump.js @@ -91,7 +91,7 @@ function init (ctx) { var prefs = pump.getPrefs(sbx); if (!prefs.enableAlerts) { return; } - + pump.warnOnSuspend = prefs.warnOnSuspend; var data = prepareData(sbx.properties.pump, prefs, sbx); @@ -130,7 +130,7 @@ function init (ctx) { } } }); - + if (result.extended) { info.push({label: '------------', value: ''}); _.forOwn(result.extended, function(value, key) { @@ -250,7 +250,7 @@ function init (ctx) { } else { result.reservoir.level = levels.NONE; } - } else if (result.manufacturer === 'Insulet' && result.model === 'Eros') { + } else if (result.manufacturer === 'Insulet') { result.reservoir = { label: 'Reservoir', display: '50+ U' } From 47d1831fb75744f655f04b685112f1f850cde4f3 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Fri, 18 Mar 2022 20:12:38 -0500 Subject: [PATCH 2/5] reservoir level override --- lib/plugins/pump.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index 2d53d50e751..797dbe577b8 100644 --- a/lib/plugins/pump.js +++ b/lib/plugins/pump.js @@ -236,11 +236,7 @@ function init (ctx) { function updateReservoir (prefs, result) { if (result.reservoir) { result.reservoir.label = 'Reservoir'; - if (result.reservoir_display_override) { - result.reservoir.display = result.reservoir_display_override; - } else { - result.reservoir.display = result.reservoir.value.toPrecision(3) + 'U'; - } + result.reservoir.display = result.reservoir.value.toPrecision(3) + 'U'; if (result.reservoir.value < prefs.urgentRes) { result.reservoir.level = levels.URGENT; result.reservoir.message = 'URGENT: Pump Reservoir Low'; @@ -255,6 +251,12 @@ function init (ctx) { label: 'Reservoir', display: '50+ U' } } + if (result.reservoir_display_override) { + result.reservoir.display = result.reservoir_display_override; + } + if (result.reservoir_level_override) { + result.reservoir.level = result.reservoir_level_override; + } } function updateBattery (type, prefs, result, batteryWarn) { From 74495b1e4c0459a2070c431246dee95ade4cd72f Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Fri, 18 Mar 2022 21:25:16 -0500 Subject: [PATCH 3/5] reservoir level override --- lib/plugins/pump.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index 797dbe577b8..a052886fa1c 100644 --- a/lib/plugins/pump.js +++ b/lib/plugins/pump.js @@ -257,6 +257,7 @@ function init (ctx) { if (result.reservoir_level_override) { result.reservoir.level = result.reservoir_level_override; } + console.log("pump result = ", result); } function updateBattery (type, prefs, result, batteryWarn) { From 28bf9e127f0727d8a856d19fad413ac9a6a71ed4 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Fri, 18 Mar 2022 21:30:06 -0500 Subject: [PATCH 4/5] reservoir level override --- lib/plugins/pump.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index a052886fa1c..a380ed66456 100644 --- a/lib/plugins/pump.js +++ b/lib/plugins/pump.js @@ -322,6 +322,7 @@ function init (ctx) { , clock: pump.clock ? { value: moment(pump.clock) } : null , reservoir: pump.reservoir || pump.reservoir === 0 ? { value: pump.reservoir } : null , reservoir_display_override: pump.reservoir_display_override || null + , reservoir_level_override: pump.reservoir_level_override || null , manufacturer: pump.manufacturer , model: pump.model , extended: pump.extended || null From 6f02d5140c67ea953629ed75ba2bbef49b87b402 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 21 Mar 2022 13:56:14 -0500 Subject: [PATCH 5/5] Remove debug print --- lib/plugins/pump.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index a380ed66456..dc087ba04f7 100644 --- a/lib/plugins/pump.js +++ b/lib/plugins/pump.js @@ -257,7 +257,6 @@ function init (ctx) { if (result.reservoir_level_override) { result.reservoir.level = result.reservoir_level_override; } - console.log("pump result = ", result); } function updateBattery (type, prefs, result, batteryWarn) {