From 2f8ca8bb044369c3988f09c9d12b56e399af2aa2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Aug 2017 15:06:31 +0200 Subject: [PATCH] fix setting zero temp --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index 21fc5a47a8..9734456cc9 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -950,6 +950,10 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { if (tempBasal.source == Source.NIGHTSCOUT) { old = getDaoTemporaryBasal().queryForId(tempBasal.date); if (old != null) { + if (!old.isAbsolute && tempBasal.isAbsolute) { // converted to absolute by "ns_sync_use_absolute" + // so far ignore, do not convert back because it may not be accurate + return false; + } if (!old.isEqual(tempBasal)) { long oldDate = old.date; getDaoTemporaryBasal().delete(old); // need to delete/create because date may change too