Skip to content

Commit

Permalink
fix pump clock; combine status time and lable
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Dec 8, 2015
1 parent a7bc56e commit e2202ed
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/plugins/openaps.js
Expand Up @@ -78,7 +78,7 @@ function init() {

var info = [];

info.push({label: 'Status', value: prop.status.label});
info.push({label: timeFormat(prop.status.when, sbx), value: prop.status.label});

var ops = prepOps(prop, sbx);
var prefs = openaps.getPrefs(sbx);
Expand Down Expand Up @@ -132,8 +132,6 @@ function init() {
info.push({label: 'Last Pump Clock', value: ops.pumpTime.format('LT')});
}

info.push({label: 'Last Update', value: timeFormat(prop.status.when, sbx)});

sbx.pluginBase.updatePillText(openaps, {
value: timeFormat(ops.lastLoopTime, sbx)
, label: 'OpenAPS ' + prop.status.symbol
Expand Down Expand Up @@ -225,7 +223,7 @@ function prepOps (prop, sbx) {

var recent = moment(sbx.time).subtract(15, 'minutes');
var iob = prop.openaps && prop.openaps.iob;
var pump = prop.openaps && prop.openaps.pump;
var pump = prop.pump;
var suggested = prop.openaps && prop.openaps.suggested;
var suggestedTime = suggested && moment(suggested.timestamp);
var enacted = prop.openaps && prop.openaps.enacted;
Expand All @@ -240,7 +238,7 @@ function prepOps (prop, sbx) {
, iob: iob
, iobTime: iob && moment(iob.timestamp)
, pump: pump
, pumpTime: pump && pump.clock && moment(prop.pump.clock)
, pumpTime: pump && pump.clock && moment(pump.clock)
, lastLoopTime: suggestedTime && enactedTime ? moment.max(suggestedTime, enactedTime) : enactedTime || suggestedTime
};
}
Expand Down

0 comments on commit e2202ed

Please sign in to comment.