From 1dd908692473e5a6164256d2a08ca9535fdbc401 Mon Sep 17 00:00:00 2001 From: RoumenGeorgiev <30696147+RoumenGeorgiev@users.noreply.github.com> Date: Mon, 7 Aug 2017 18:53:56 +0300 Subject: [PATCH] added snoozing if bgReadingAgo is smaller than threshold --- .../nightscout/androidaps/plugins/Overview/Notification.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java index a8bdad32c3..9f35599b36 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java @@ -1,3 +1,4 @@ + package info.nightscout.androidaps.plugins.Overview; import java.util.Date; @@ -174,6 +175,9 @@ public class Notification { if((bgReadingAgoMin > threshold && SP.getBoolean(R.string.key_nsalarm_staledata, false))||(bgReadingAgoMin > threshold && openAPSEnabledAlerts)){ return true; } + //snoozing for threshold + SP.putLong("snoozedTo", (long) (bgReading.date+(threshold*1000*60L))); + //log.debug("New bg data is available Alarm is snoozed for next "+threshold*1000*60+" seconds"); return false; } }