Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnipod reservoir fixes #7380

Merged
merged 5 commits into from
Apr 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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