From 9e2968f21a80aeb3e41b45f4da461af098b3e77c Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 4 Oct 2017 16:00:48 +0200 Subject: [PATCH 1/2] Do not misinterpret a fake-extended as 0% temp. --- .../nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java index 1a1819640f..c335eb2039 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java @@ -507,7 +507,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C if (percent > getPumpDescription().maxTempPercent) percent = getPumpDescription().maxTempPercent; TemporaryBasal runningTB = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()); - if (runningTB != null && runningTB.percentRate == percent) { + if (runningTB != null && runningTB.percentRate == percent && !(runningTB.isAbsolute|runningTB.isFakeExtended)) { result.enacted = false; result.success = true; result.isTempCancel = false; From 3d2647321b71c3c795c7f57c5d45920a1472ea81 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 4 Oct 2017 16:51:54 +0200 Subject: [PATCH 2/2] getTempBasalFromHistory -> getRealTempBasalFromHistory --- .../nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java index c335eb2039..f5bc5a0130 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java @@ -506,8 +506,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C } if (percent > getPumpDescription().maxTempPercent) percent = getPumpDescription().maxTempPercent; - TemporaryBasal runningTB = MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()); - if (runningTB != null && runningTB.percentRate == percent && !(runningTB.isAbsolute|runningTB.isFakeExtended)) { + TemporaryBasal runningTB = MainApp.getConfigBuilder().getRealTempBasalFromHistory(System.currentTimeMillis()); + if (runningTB != null && runningTB.percentRate == percent) { result.enacted = false; result.success = true; result.isTempCancel = false;