From 258034ca8dd9f22fbea35499987ddd140f1648e1 Mon Sep 17 00:00:00 2001 From: TebbeUbben Date: Sat, 19 Jan 2019 11:54:05 +0100 Subject: [PATCH] Don't refresh status twice when setting TBR Return duration in TBR PumpEnactResult --- .../plugins/PumpInsightLocal/LocalInsightPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java index d32ce09948..e7c40cd711 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsightLocal/LocalInsightPlugin.java @@ -611,6 +611,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con result.enacted = true; result.isPercent = false; result.absolute = absoluteRate; + result.duration = durationInMinutes; result.comment = MainApp.gs(R.string.virtualpump_resultok); } else { result.comment = ebResult.comment; @@ -619,13 +620,13 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con result.comment = cancelTBRResult.comment; } } else { - result = setTempBasalPercent((int) Math.round(percent), durationInMinutes, profile, enforceNew); + return setTempBasalPercent((int) Math.round(percent), durationInMinutes, profile, enforceNew); } } else { result.comment = cancelEBResult.comment; } } else { - result = setTempBasalPercent((int) Math.round(percent), durationInMinutes, profile, enforceNew); + return setTempBasalPercent((int) Math.round(percent), durationInMinutes, profile, enforceNew); } try { fetchStatus(); @@ -656,6 +657,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con } result.isPercent = true; result.percent = percent; + result.duration = durationInMinutes; result.success = true; result.enacted = true; result.comment = MainApp.gs(R.string.virtualpump_resultok);