diff --git a/lib/plugins/pump.js b/lib/plugins/pump.js index 8a0d397a300..dc087ba04f7 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) { @@ -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'; @@ -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) { @@ -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