VirtualPump: do not cancel percent temp prior adding new

This commit is contained in:
Milos Kozak 2018-09-11 23:23:59 +02:00
parent 874be7ff48
commit 0a52bc9976

View file

@ -288,17 +288,12 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
@Override
public PumpEnactResult setTempBasalPercent(Integer percent, Integer durationInMinutes, Profile profile, boolean enforceNew) {
PumpEnactResult result = new PumpEnactResult();
if (TreatmentsPlugin.getPlugin().isTempBasalInProgress()) {
result = cancelTempBasal(false);
if (!result.success)
return result;
}
TemporaryBasal tempBasal = new TemporaryBasal()
.date(System.currentTimeMillis())
.percent(percent)
.duration(durationInMinutes)
.source(Source.USER);
PumpEnactResult result = new PumpEnactResult();
result.success = true;
result.enacted = true;
result.percent = percent;