Run loop when TemporyTarget is changed

This commit is contained in:
harisp 2019-03-06 12:10:28 +01:00
parent 1a73d60535
commit 605601bcc6

View file

@ -34,6 +34,7 @@ import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.interfaces.APSInterface;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.PluginBase;
@ -175,6 +176,14 @@ public class LoopPlugin extends PluginBase {
return loopSuspendedTill;
}
@Subscribe
public void onStatusEvent(final EventTempTargetChange ev) {
new Thread(() -> LoopPlugin.getPlugin().invoke("EventTempTargetChange", true)).start();
FabricPrivacy.getInstance().logCustom(new CustomEvent("TT_Loop_Run"));
}
public void suspendTo(long endTime) {
loopSuspendedTill = endTime;
isSuperBolus = false;