Fix reporting implicitly cancelled TBRs

This commit is contained in:
Bart Sopers 2020-08-27 22:20:42 +02:00
parent 77b359fa74
commit ede70fdf6c

View file

@ -543,19 +543,19 @@ public class AapsOmnipodManager {
} }
private void reportImplicitlyCancelledTbr() { private void reportImplicitlyCancelledTbr() {
//TreatmentsPlugin plugin = TreatmentsPlugin.getPlugin();
TreatmentsInterface plugin = activePlugin.getActiveTreatments(); TreatmentsInterface plugin = activePlugin.getActiveTreatments();
if (plugin.isTempBasalInProgress()) { if (plugin.isTempBasalInProgress()) {
aapsLogger.debug(LTag.PUMP, "Reporting implicitly cancelled TBR to Treatments plugin"); aapsLogger.debug(LTag.PUMP, "Reporting implicitly cancelled TBR to Treatments plugin");
long time = System.currentTimeMillis() - 1000; long time = System.currentTimeMillis() - 1000;
addSuccessToHistory(time, PodHistoryEntryType.CANCEL_TEMPORARY_BASAL_BY_DRIVER, null); long pumpId = addSuccessToHistory(time, PodHistoryEntryType.CANCEL_TEMPORARY_BASAL_BY_DRIVER, null);
TemporaryBasal temporaryBasal = new TemporaryBasal(injector) // TemporaryBasal temporaryBasal = new TemporaryBasal(injector) //
.date(time) // .date(time) //
.duration(0) // .duration(0) //
.source(Source.PUMP); .source(Source.PUMP) //
.pumpId(pumpId);
plugin.addToHistoryTempBasal(temporaryBasal); plugin.addToHistoryTempBasal(temporaryBasal);
} }