Skip to content

Commit

Permalink
combine the iob and bolus snooze lines, and move above pump clock
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Dec 2, 2015
1 parent eec7156 commit d59a551
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lib/plugins/openaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,27 @@ function init() {
});
}

if (prop.openaps && prop.openaps.iob) {
var iobTime = moment(prop.openaps.iob.timestamp);
if (iobTime.isAfter(recent)) {
info.push({
label: 'IOB'
, value: [
sbx.roundInsulinForDisplayFormat(prop.openaps.iob.iob) + 'U'
, ', Bolus Snooze ' + sbx.roundInsulinForDisplayFormat(prop.openaps.iob.bolusiob) + 'U'
, timeAt(true, sbx) + timeFormat(iobTime, sbx)
].join('')
});
}
}

if (prop.pump && prop.pump.clock) {
var pumpTime = moment(prop.pump.clock);
if (pumpTime.isAfter(recent)) {
info.push({label: 'Last Pump Clock', value: pumpTime.format('LT')});
}
}

if (prop.openaps && prop.openaps.iob) {
var iobTime = moment(prop.openaps.iob.timestamp);
if (iobTime.isAfter(recent)) {
info.push({label: 'IOB', value: sbx.roundInsulinForDisplayFormat(prop.openaps.iob.iob) + 'U' + timeAt(true, sbx) + timeFormat(iobTime, sbx)});
info.push({label: 'Bolus Snooze IOB', value: sbx.roundInsulinForDisplayFormat(prop.openaps.iob.bolusiob) + 'U'});
}
}

sbx.pluginBase.updatePillText(openaps, {
value: timeFormat(prop.status.when, sbx)
, label: 'OpenAPS ' + prop.status.symbol
Expand Down

0 comments on commit d59a551

Please sign in to comment.