snooze carb alerts for 15 min after treatments

This commit is contained in:
Tim Gunn 2020-05-31 16:43:07 +12:00
parent 28f2630a91
commit 8aabf15dfe
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -337,6 +337,14 @@ public class LoopPlugin extends PluginBase implements LoopInterface {
}
return isDisconnected;
}
public boolean treatmentTimethreshold(int duartionMinutes) {
long threshold = System.currentTimeMillis() + (duartionMinutes*60*1000);
boolean bool = false;
if (treatmentsPlugin.getLastBolusTime() > threshold || treatmentsPlugin.getLastCarbTime() > threshold)
bool = true;
return bool;
}
public synchronized void invoke(String initiator, boolean allowNotification) {
invoke(initiator, allowNotification, false);