Insight treat 100% TBR from absolute as cancel

This commit is contained in:
Jamorham 2018-02-05 11:33:00 +00:00
parent 1d169bc27f
commit 44ba10e00c
No known key found for this signature in database
GPG key ID: 0BC5C3E0AAD64DF9

View file

@ -463,6 +463,11 @@ public class InsightPumpPlugin implements PluginBase, PumpInterface, Constraints
log("Calculated requested rate: " + absoluteRate + " base rate: " + base_basal + " percentage: " + amount + "%");
amount = (int) Math.round(((double) amount) / 10d) * 10;
log("Calculated final rate: " + amount + "%");
if (amount == 100) {
return cancelTempBasal(false);
}
if (amount > 250) amount = 250;
final SetTBRTaskRunner task = new SetTBRTaskRunner(connector.getServiceConnector(), amount, durationInMinutes);