From b463f915e1b23dde2cb09daa22c8eaa4c96b5483 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Mon, 30 Dec 2019 17:50:30 +0100 Subject: [PATCH] - fixed cancel Tbr reporting --- .../pump/omnipod/driver/comm/AapsOmnipodManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java index a9c8fad873..ca67490122 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java @@ -499,12 +499,16 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface LOG.debug("Reporting implicitly cancelled TBR to Treatments plugin"); } + long time = System.currentTimeMillis(); + + addSuccessToHistory(time, PodHistoryEntryType.CancelTemporaryBasalForce, null); + TemporaryBasal temporaryBasal = new TemporaryBasal() // - .date(System.currentTimeMillis()) // + .date(time) // .duration(0) // - // TODO bs should be Source.PUMP imo, but that doesn't work: - // it says a TEMPBASAL record already exists - .source(Source.USER); + .pumpId(pumpStatus.tempBasalPumpId) + .source(Source.PUMP); + plugin.addToHistoryTempBasal(temporaryBasal); } }