From 8cf69006b2a72fbee68baa1efb546a51854557da Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 7 Jan 2018 11:13:02 +0100 Subject: [PATCH] check 30min interval only for basal rates --- .../info/nightscout/androidaps/data/Profile.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/data/Profile.java b/app/src/main/java/info/nightscout/androidaps/data/Profile.java index c1e0f05885..b2e5d0d9dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/Profile.java +++ b/app/src/main/java/info/nightscout/androidaps/data/Profile.java @@ -174,10 +174,6 @@ public class Profile { } double value = o.getDouble("value") * multiplier; sparse.put(tas, value); - if (tas % 3600 != 0) { - Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, MainApp.sResources.getString(R.string.basalprofilenotaligned), Notification.URGENT); - MainApp.bus().post(new EventNewNotification(notification)); - } if (value == 0) { Notification notification = new Notification(Notification.ZERO_VALUE_IN_PROFILE, MainApp.sResources.getString(R.string.zerovalueinprofile), Notification.URGENT); MainApp.bus().post(new EventNewNotification(notification)); @@ -345,6 +341,14 @@ public class Profile { public Double getBasal(Integer timeAsSeconds) { if (basal_v == null) { basal_v = convertToSparseArray(basal); + for (int index = 0; index < basal_v.size(); index++) { + long secondsFromMidnight = basal_v.keyAt(index); + if (secondsFromMidnight % 3600 != 0) { + Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, MainApp.sResources.getString(R.string.basalprofilenotaligned), Notification.URGENT); + MainApp.bus().post(new EventNewNotification(notification)); + } + } + // Check for minimal basal value PumpInterface pump = ConfigBuilderPlugin.getActivePump(); if (pump != null) {