Return pump enact failure when base basal ist 0 duration execution of setTempBasalAbsolute

This commit is contained in:
TebbeUbben 2019-02-02 01:38:01 +01:00
parent 1ffd63c83a
commit a282124497

View file

@ -580,6 +580,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
public PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes, Profile profile, boolean enforceNew) { public PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes, Profile profile, boolean enforceNew) {
PumpEnactResult result = new PumpEnactResult(); PumpEnactResult result = new PumpEnactResult();
if (activeBasalRate == null) return result; if (activeBasalRate == null) return result;
if (activeBasalRate.getActiveBasalRate() == 0) return result;
double percent = 100D / activeBasalRate.getActiveBasalRate() * absoluteRate; double percent = 100D / activeBasalRate.getActiveBasalRate() * absoluteRate;
if (isFakingTempsByExtendedBoluses()) { if (isFakingTempsByExtendedBoluses()) {
PumpEnactResult cancelEBResult = cancelExtendedBolusOnly(); PumpEnactResult cancelEBResult = cancelExtendedBolusOnly();