Skip to content

Commit

Permalink
Merge branch 'dev' into automatic-bolus
Browse files Browse the repository at this point in the history
  • Loading branch information
bewest authored Apr 19, 2022
2 parents 9ce3920 + ad1bcbf commit eb8b71c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/plugins/pump.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -130,7 +130,7 @@ function init (ctx) {
}
}
});

if (result.extended) {
info.push({label: '------------', value: ''});
_.forOwn(result.extended, function(value, key) {
Expand Down Expand Up @@ -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';
Expand All @@ -250,11 +246,17 @@ 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'
}
}
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) {
Expand Down Expand Up @@ -319,6 +321,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
Expand Down

0 comments on commit eb8b71c

Please sign in to comment.