Don't run loop for back-filled BG either.

This commit is contained in:
Johannes Mockenhaupt 2018-03-17 19:46:15 +01:00
parent a7ca483565
commit 17d5945a91
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -23,6 +23,7 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.events.EventNewBG; import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTreatmentChange; import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.interfaces.APSInterface; import info.nightscout.androidaps.interfaces.APSInterface;
@ -163,7 +164,9 @@ public class LoopPlugin implements PluginBase {
return; return;
EventNewBG bgEv = (EventNewBG) ev.cause; EventNewBG bgEv = (EventNewBG) ev.cause;
if (bgEv.isNew && bgEv.isFromActiveBgSource) { BgReading bg = bgEv.bgReading;
if (bgEv.isNew && bgEv.isFromActiveBgSource
&& bg != null && bg.date + 9 * 60 * 1000 > System.currentTimeMillis()) {
invoke("New BG", true); invoke("New BG", true);
} }
} }