Merge pull request #500 from jotomo/prevent-gaps-in-tbr

ConfigBuilder.applyAPSRequest: set new TBR if current TBR expires bef…
This commit is contained in:
Milos Kozak 2017-11-22 10:52:15 +01:00 committed by GitHub
commit 62527ab33b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -584,7 +584,9 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
if (Config.logCongigBuilderActions)
log.debug("applyAPSRequest: Basal set correctly");
}
} else if (isTempBasalInProgress() && Math.abs(request.rate - getTempBasalAbsoluteRateHistory()) < getPumpDescription().basalStep) {
} else if (isTempBasalInProgress()
&& getTempBasalRemainingMinutesFromHistory() > 5
&& Math.abs(request.rate - getTempBasalAbsoluteRateHistory()) < getPumpDescription().basalStep) {
result = new PumpEnactResult();
result.absolute = getTempBasalAbsoluteRateHistory();
result.duration = getTempBasalFromHistory(System.currentTimeMillis()).getPlannedRemainingMinutes();