Set result.bolusDelivered in Insight driver

This commit is contained in:
Tebbe Ubben 2019-03-31 01:39:08 +01:00
parent ae60d68719
commit 4b86a07eac

View file

@ -512,6 +512,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
PumpEnactResult result = new PumpEnactResult(); PumpEnactResult result = new PumpEnactResult();
if (detailedBolusInfo.insulin > 0) { if (detailedBolusInfo.insulin > 0) {
try { try {
detailedBolusInfo.insulin = Math.round(detailedBolusInfo.insulin / 0.01) * 0.01;
synchronized ($bolusLock) { synchronized ($bolusLock) {
DeliverBolusMessage bolusMessage = new DeliverBolusMessage(); DeliverBolusMessage bolusMessage = new DeliverBolusMessage();
bolusMessage.setBolusType(BolusType.STANDARD); bolusMessage.setBolusType(BolusType.STANDARD);
@ -592,6 +593,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
result.enacted = true; result.enacted = true;
} }
result.carbsDelivered = detailedBolusInfo.carbs; result.carbsDelivered = detailedBolusInfo.carbs;
result.bolusDelivered = detailedBolusInfo.insulin;
return result; return result;
} }