diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java index eecb0d3e25..d245bdd816 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.java @@ -409,7 +409,9 @@ public class LoopPlugin extends PluginBase { if (closedLoopEnabled.value()) { if (allowNotification) { - if (resultAfterConstraints.isCarbsRequired() && carbsSuggestionsSuspendedUntil < System.currentTimeMillis()) { + if (resultAfterConstraints.isCarbsRequired() + && resultAfterConstraints.carbsReq >= sp.getInt(R.string.key_smb_enable_carbs_suggestions_threshold, 0) + && carbsSuggestionsSuspendedUntil < System.currentTimeMillis()) { Intent intentAction5m = new Intent(context, CarbSuggestionReceiver.class); intentAction5m.putExtra("ignoreDuration",5); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.java b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.java index 746737ec0f..0c0c5e17ed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.java @@ -36,8 +36,7 @@ public class DetermineBasalResultSMB extends APSResult { //if (result.has("insulinReq")) insulinReq = result.getDouble("insulinReq"); if (SP.getBoolean(R.string.key_smb_enable_carbs_suggestions, false)) { - if (result.has("carbsReq") && result.getInt("carbsReq") >= SP.getInt(R.string.key_smb_enable_carbs_suggestions_threshold, 0)) - carbsReq = result.getInt("carbsReq"); + if (result.has("carbsReq")) carbsReq = result.getInt("carbsReq"); if (result.has("carbsReqWithin")) carbsReqWithin = result.getInt("carbsReqWithin"); }