From dc6c91fd87045875b2c16297ae88f628a26c3d90 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 26 Nov 2017 21:03:22 +0100 Subject: [PATCH] Set Source.PUMP when setting/cancelling TBR. While technically, the history isn't read, we can be reasonably sure a TBR was set/cancelled by reading the main menu (and for TBR starts that's the only way to do so). Reading the history might cause (more) problems with the pump's minute-precision and not yield much safety. Besides, command mode is expected to take over yesterday. (cherry picked from commit 04fb1c8) --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index d9fa3ca934..94e2da3a4b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -627,7 +627,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf tempStart.durationInMinutes = durationInMinutes; tempStart.percentRate = adjustedPercent; tempStart.isAbsolute = false; - tempStart.source = Source.USER; + tempStart.source = Source.PUMP; tempStart.pumpId = tempStart.date; ConfigBuilderPlugin treatmentsInterface = MainApp.getConfigBuilder(); treatmentsInterface.addToHistoryTempBasal(tempStart); @@ -658,7 +658,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf TemporaryBasal tempBasal = new TemporaryBasal(); tempBasal.date = commandResult.state.timestamp; tempBasal.durationInMinutes = 0; - tempBasal.source = Source.USER; + tempBasal.source = Source.PUMP; tempBasal.pumpId = activeTemp.pumpId; MainApp.getConfigBuilder().addToHistoryTempBasal(tempBasal); return new PumpEnactResult().isTempCancel(true).success(true).enacted(true); @@ -684,7 +684,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf TemporaryBasal tempBasal = new TemporaryBasal(); tempBasal.date = System.currentTimeMillis() / (60 * 1000) * (60 * 1000); tempBasal.durationInMinutes = 15; - tempBasal.source = Source.USER; + tempBasal.source = Source.PUMP; tempBasal.pumpId = tempBasal.date; tempBasal.percentRate = percentage; tempBasal.isAbsolute = false;