diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index ceca24839f..89d66fd891 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -417,6 +417,7 @@ public class IobCobCalculatorPlugin extends PluginBase { if (autosensData != null) { displayCob = autosensData.cob; for (Treatment treatment : treatments) { + if (!treatment.isValid) continue; if (IobCobCalculatorPlugin.roundUpTime(treatment.date) > IobCobCalculatorPlugin.roundUpTime(autosensData.time) && treatment.date <= now && treatment.carbs > 0) { displayCob += treatment.carbs; @@ -424,6 +425,7 @@ public class IobCobCalculatorPlugin extends PluginBase { } } for (Treatment treatment : treatments) { + if (!treatment.isValid) continue; if (treatment.date > now && treatment.carbs > 0) { futureCarbs += treatment.carbs; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 55129cdc7b..8ae2e6d7b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -284,6 +284,8 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface long last = 0; synchronized (treatments) { for (Treatment t : treatments) { + if (!t.isValid) + continue; if (t.date > last && t.insulin > 0 && t.isValid && t.date <= now) last = t.date; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java index 696b8b0b57..6a242c7c7a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/wearintegration/WatchUpdaterService.java @@ -465,7 +465,7 @@ public class WatchUpdaterService extends WearableListenerService implements List treatments = TreatmentsPlugin.getPlugin().getTreatmentsFromHistory(); for (Treatment treatment : treatments) { - if (treatment.date > startTimeWindow) { + if (treatment.isValid && treatment.date > startTimeWindow) { boluses.add(treatmentMap(treatment.date, treatment.insulin, treatment.carbs, treatment.isSMB, treatment.isValid)); }