diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java index 1c9fdaaaf7..51313d7f04 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java @@ -97,6 +97,8 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface { pumpDescription.basalMinimumRate = 0.01d; pumpDescription.isRefillingCapable = false; + + pumpDescription.storesCarbInfo = false; } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index febd7509f5..636a935787 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.Wear; +import android.Manifest; import android.os.HandlerThread; import android.support.annotation.NonNull; @@ -644,16 +645,20 @@ public class ActionStringHandler { detailedBolusInfo.insulin = amount; detailedBolusInfo.carbs = carbs; detailedBolusInfo.source = Source.USER; - ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() { - @Override - public void run() { - if (!result.success) { - sendError(MainApp.sResources.getString(R.string.treatmentdeliveryerror) + - "\n" + - result.comment); + if (detailedBolusInfo.insulin > 0 || ConfigBuilderPlugin.getActivePump().getPumpDescription().storesCarbInfo) { + ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() { + @Override + public void run() { + if (!result.success) { + sendError(MainApp.sResources.getString(R.string.treatmentdeliveryerror) + + "\n" + + result.comment); + } } - } - }); + }); + } else { + MainApp.getConfigBuilder().addToHistoryTreatment(detailedBolusInfo); + } } private synchronized static void sendError(String errormessage) {