diff --git a/core/keys/src/main/kotlin/app/aaps/core/keys/StringKey.kt b/core/keys/src/main/kotlin/app/aaps/core/keys/StringKey.kt index 2bb054853d6..932dc35bf85 100644 --- a/core/keys/src/main/kotlin/app/aaps/core/keys/StringKey.kt +++ b/core/keys/src/main/kotlin/app/aaps/core/keys/StringKey.kt @@ -39,6 +39,7 @@ enum class StringKey( AutomationLocation("location", "PASSIVE", hideParentScreenIfHidden = true), SmsAllowedNumbers("smscommunicator_allowednumbers", ""), + SmsReceiverNumber("sms_communicator_receiver_number", "", showInApsMode = false, showInPumpControlMode = false, dependency = BooleanKey.SmsAllowRemoteCommands), SmsOtpPassword("smscommunicator_otp_password", "", dependency = BooleanKey.SmsAllowRemoteCommands), VirtualPumpType("virtualpump_type", "Generic AAPS"), diff --git a/core/objects/src/main/kotlin/app/aaps/core/objects/wizard/BolusWizard.kt b/core/objects/src/main/kotlin/app/aaps/core/objects/wizard/BolusWizard.kt index 29f87a91f0b..db8b30656ca 100644 --- a/core/objects/src/main/kotlin/app/aaps/core/objects/wizard/BolusWizard.kt +++ b/core/objects/src/main/kotlin/app/aaps/core/objects/wizard/BolusWizard.kt @@ -37,12 +37,15 @@ import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.bus.RxBus import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.interfaces.sharedPreferences.SP +import app.aaps.core.interfaces.smsCommunicator.Sms +import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.Round import app.aaps.core.keys.BooleanKey import app.aaps.core.keys.Preferences +import app.aaps.core.keys.StringKey import app.aaps.core.objects.constraints.ConstraintObject import app.aaps.core.objects.extensions.formatColor import app.aaps.core.objects.extensions.highValueToUnitsToString @@ -63,6 +66,7 @@ class BolusWizard @Inject constructor( val injector: HasAndroidInjector ) { + @Inject lateinit var smsCommunicator: SmsCommunicator @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var rh: ResourceHelper @Inject lateinit var rxBus: RxBus @@ -86,9 +90,12 @@ class BolusWizard @Inject constructor( @Inject lateinit var processedDeviceStatusData: ProcessedDeviceStatusData var timeStamp: Long + // var phoneNumber: String init { injector.androidInjector().inject(this) + // why this@BolusWizar.phoneNumber not visible in scoped DetailedBolusInfo().apply + // phoneNumber = preferences.get(StringKey.SmsReceiverNumber) timeStamp = dateUtil.now() } @@ -330,7 +337,7 @@ class BolusWizard @Inject constructor( } private fun confirmMessageAfterConstraints(context: Context, advisor: Boolean, quickWizardEntry: QuickWizardEntry? = null): Spanned { - + var phoneNumber = preferences.get(StringKey.SmsReceiverNumber) val actions: LinkedList = LinkedList() if (insulinAfterConstraints > 0) { val pct = if (percentageCorrection != 100) " ($percentageCorrection%)" else "" @@ -371,7 +378,10 @@ class BolusWizard @Inject constructor( .formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor) ) if (config.NSCLIENT && insulinAfterConstraints > 0) - actions.add(rh.gs(app.aaps.core.ui.R.string.bolus_recorded_only).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) + if (preferences.get(BooleanKey.SmsAllowRemoteCommands) && !phoneNumber.isNullOrBlank()) + actions.add(rh.gs(app.aaps.core.ui.R.string.sms_bolus_notification).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) + else + actions.add(rh.gs(app.aaps.core.ui.R.string.bolus_recorded_only).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) if (useAlarm && !advisor && carbs > 0 && carbTime > 0) actions.add(rh.gs(app.aaps.core.ui.R.string.alarminxmin, carbTime).formatColor(context, rh, app.aaps.core.ui.R.attr.infoColor)) if (advisor) @@ -538,6 +548,13 @@ class BolusWizard @Inject constructor( ValueWithUnit.Minute(carbTime).takeIf { carbTime != 0 } ).filterNotNull() ) + var phoneNumber = preferences.get(StringKey.SmsReceiverNumber) + if (preferences.get(BooleanKey.SmsAllowRemoteCommands) && !phoneNumber.isNullOrBlank()) { + rh.gs(app.aaps.core.ui.R.string.sms_bolus_notification).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor) + smsCommunicator.sendSMS(Sms(phoneNumber, rh.gs(app.aaps.core.ui.R.string.bolus) + " " + insulin)) + insulin = 0.0 // commandQueue will process carbs + } + commandQueue.bolus(this, object : Callback() { override fun run() { if (!result.success) { diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 6f5ed8199ad..bc73a54ff4e 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -452,9 +452,11 @@ COB vs IOB !!!!! Slow carbs absorption detected: %2$d%% of time. Double check your calculation. COB can be overestimated thus more insulin could be given !!!!!]]> Deliver this part of bolus wizard result [%] + Receiver phone number for sms commands sent from AAPSClient phone Old glycemia time threshold [min] Bolus constraint applied: %1$.2f U to %2$.2f U Bolus will be recorded only (not delivered by pump) + Send sms with insulin request Run alarm when is time to eat No action selected, nothing will happen Carbs = 0. No action taken! diff --git a/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/overview/OverviewPlugin.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/overview/OverviewPlugin.kt index c92e4bf97f8..3f1f60b916e 100644 --- a/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/overview/OverviewPlugin.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/overview/OverviewPlugin.kt @@ -41,10 +41,13 @@ import app.aaps.core.objects.extensions.putString import app.aaps.core.objects.extensions.store import app.aaps.core.objects.extensions.storeBoolean import app.aaps.core.objects.extensions.storeString +import app.aaps.core.validators.DefaultEditTextValidator +import app.aaps.core.validators.EditTextValidator import app.aaps.core.validators.preferences.AdaptiveClickPreference import app.aaps.core.validators.preferences.AdaptiveDoublePreference import app.aaps.core.validators.preferences.AdaptiveIntPreference import app.aaps.core.validators.preferences.AdaptiveIntentPreference +import app.aaps.core.validators.preferences.AdaptiveStringPreference import app.aaps.core.validators.preferences.AdaptiveSwitchPreference import app.aaps.core.validators.preferences.AdaptiveUnitPreference import app.aaps.plugins.main.R @@ -219,6 +222,13 @@ class OverviewPlugin @Inject constructor( addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.OverviewShowTreatmentButton, title = R.string.treatments)) addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.OverviewShowWizardButton, title = R.string.calculator_label)) addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.OverviewShowInsulinButton, title = app.aaps.core.ui.R.string.configbuilder_insulin)) + addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.SmsAllowRemoteCommands, summary = R.string.client_allow_sms_warning, title = R.string.client_allow_sms)) + addPreference( + AdaptiveStringPreference( + ctx = context, stringKey = StringKey.SmsReceiverNumber, dialogMessage = R.string.sms_receiver_number_dialog, title = app.aaps.core.ui.R.string.sms_receiver_number, + validatorParams = DefaultEditTextValidator.Parameters(testType = EditTextValidator.TEST_PHONE) + ) + ) addPreference(AdaptiveDoublePreference(ctx = context, doubleKey = DoubleKey.OverviewInsulinButtonIncrement1, dialogMessage = R.string.insulin_increment_button_message, title = R.string.firstinsulinincrement)) addPreference(AdaptiveDoublePreference(ctx = context, doubleKey = DoubleKey.OverviewInsulinButtonIncrement2, dialogMessage = R.string.insulin_increment_button_message, title = R.string.secondinsulinincrement)) addPreference(AdaptiveDoublePreference(ctx = context, doubleKey = DoubleKey.OverviewInsulinButtonIncrement3, dialogMessage = R.string.insulin_increment_button_message, title = R.string.thirdinsulinincrement)) @@ -279,13 +289,17 @@ class OverviewPlugin @Inject constructor( addPreference(AdaptiveIntPreference(ctx = context, intKey = IntKey.OverviewResCritical, title = R.string.statuslights_res_critical)) addPreference(AdaptiveIntPreference(ctx = context, intKey = IntKey.OverviewBattWarning, title = R.string.statuslights_bat_warning)) addPreference(AdaptiveIntPreference(ctx = context, intKey = IntKey.OverviewBattCritical, title = R.string.statuslights_bat_critical)) - addPreference(AdaptiveClickPreference(ctx = context, stringKey = StringKey.OverviewCopySettingsFromNs, title = R.string.statuslights_copy_ns, - onPreferenceClickListener = { - nsSettingStatus.copyStatusLightsNsSettings(context) - true - })) + addPreference( + AdaptiveClickPreference(ctx = context, stringKey = StringKey.OverviewCopySettingsFromNs, title = R.string.statuslights_copy_ns, + onPreferenceClickListener = { + nsSettingStatus.copyStatusLightsNsSettings(context) + true + }) + ) }) addPreference(AdaptiveIntPreference(ctx = context, intKey = IntKey.OverviewBolusPercentage, dialogMessage = R.string.deliverpartofboluswizard, title = app.aaps.core.ui.R.string.partialboluswizard)) + + addPreference(AdaptiveIntPreference(ctx = context, intKey = IntKey.OverviewResetBolusPercentageTime, dialogMessage = R.string.deliver_part_of_boluswizard_reset_time, title = app.aaps.core.ui.R.string.partialboluswizard_reset_time)) addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.OverviewUseBolusAdvisor, summary = R.string.enable_bolus_advisor_summary, title = R.string.enable_bolus_advisor)) addPreference(AdaptiveSwitchPreference(ctx = context, booleanKey = BooleanKey.OverviewUseBolusReminder, summary = R.string.enablebolusreminder_summary, title = R.string.enablebolusreminder)) diff --git a/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/smsCommunicator/SmsCommunicatorPlugin.kt index 7e36ee88d28..60f2317aa1d 100644 --- a/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/main/src/main/kotlin/app/aaps/plugins/main/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -933,11 +933,12 @@ class SmsCommunicatorPlugin @Inject constructor( if (divided.size == 3 && !isMeal) { sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) } else if (bolus > 0.0) { + val iob = iobCobCalculator.calculateIobFromBolus().round().iob + iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round().basaliob val passCode = generatePassCode() val reply = if (isMeal) - rh.gs(R.string.smscommunicator_meal_bolus_reply_with_code, bolus, passCode) + rh.gs(R.string.smscommunicator_meal_bolus_reply_with_code, bolus, passCode, iob) else - rh.gs(R.string.smscommunicator_bolus_reply_with_code, bolus, passCode) + rh.gs(R.string.smscommunicator_bolus_reply_with_code, bolus, passCode, iob) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, bolus) { override fun run() { diff --git a/plugins/main/src/main/res/values/strings.xml b/plugins/main/src/main/res/values/strings.xml index 2796978e7dc..615c6037ffd 100644 --- a/plugins/main/src/main/res/values/strings.xml +++ b/plugins/main/src/main/res/values/strings.xml @@ -2,7 +2,6 @@ - SMS Communicator SMS Remote control AAPS using SMS commands. @@ -34,8 +33,8 @@ Timeout while waiting for finish of previous pump communication Allowed phone numbers +XXXXXXXXXX;+YYYYYYYYYY - To deliver bolus %1$.2fU reply with code %2$s - To deliver meal bolus %1$.2fU reply with code %2$s + To deliver bolus %1$.2fU reply with code %2$s. Current IOB is %3$.2fU + To deliver meal bolus %1$.2fU reply with code %2$s. Current IOB is %3$.2fU To set the Temp Target %1$s reply with code %2$s To cancel Temp Target reply with code %1$s To disable the SMS Remote Service reply with code %1$s.\n\nKeep in mind that you\'ll able to reactivate it directly from the AAPS master smartphone only. @@ -186,7 +185,7 @@ patch pump age Patch pump - + Show status lights on home screen Threshold warning cannula age [h] Threshold critical cannula age [h] @@ -276,8 +275,12 @@ Enable bolus reminder Use reminder to bolus later with wizard ("post-bolus") Run %s? + + If number is provided, insulin and calculator buttons will be able to send SMS command to inject bolus. Note that you still need to confirm it and reply with security token/code. Note that you need to enabled SMS control of AAPS phone to use this function. + Allow AAPSClient to send SMS with bolus command + "Use this functionality with caution. Before enabling make sure that IOB and BG is synchronized between AAPS and AAPSClient. Some users reported issue with that. Use it at your own risk, every time you shall check IOB and BG before issuing a bolus. You can do that by sending 'BG' command." - + graphconfig Predictions Treatments diff --git a/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt index 617c86d46ef..58df02788ad 100644 --- a/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt @@ -30,11 +30,15 @@ import app.aaps.core.interfaces.pump.defs.determineCorrectBolusStepSize import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.core.interfaces.smsCommunicator.Sms +import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.SafeParse +import app.aaps.core.keys.BooleanKey import app.aaps.core.keys.DoubleKey import app.aaps.core.keys.IntKey +import app.aaps.core.keys.StringKey import app.aaps.core.keys.UnitDoubleKey import app.aaps.core.objects.constraints.ConstraintObject import app.aaps.core.objects.extensions.formatColor @@ -58,6 +62,7 @@ import kotlin.math.max class InsulinDialog : DialogFragmentWithDate() { + @Inject lateinit var smsCommunicator: SmsCommunicator @Inject lateinit var constraintChecker: ConstraintsChecker @Inject lateinit var rh: ResourceHelper @Inject lateinit var profileFunction: ProfileFunction @@ -125,8 +130,16 @@ class InsulinDialog : DialogFragmentWithDate() { val pump = activePlugin.activePump if (config.NSCLIENT) { - binding.recordOnly.isChecked = true - binding.recordOnly.isEnabled = false + // If SmsAllowRemoteCommands is True and valid phone number is provided. then user might use either SMS command or record only. + // Hardcode record_only option otherwise + val allowSms = preferences.get(BooleanKey.SmsAllowRemoteCommands) + if(allowSms) { + binding.recordOnly.isEnabled = !preferences.get(StringKey.SmsReceiverNumber).isNullOrBlank() + binding.recordOnly.isChecked = preferences.get(StringKey.SmsReceiverNumber).isNullOrBlank() + } else { + binding.recordOnly.isEnabled = false + binding.recordOnly.isChecked = true + } } val maxInsulin = constraintChecker.getMaxBolusAllowed().value() @@ -197,8 +210,10 @@ class InsulinDialog : DialogFragmentWithDate() { val actions: LinkedList = LinkedList() val units = profileFunction.getUnits() val unitLabel = if (units == GlucoseUnit.MMOL) rh.gs(app.aaps.core.ui.R.string.mmol) else rh.gs(app.aaps.core.ui.R.string.mgdl) + val phoneNumber = preferences.get(StringKey.SmsReceiverNumber) val recordOnlyChecked = binding.recordOnly.isChecked val eatingSoonChecked = binding.startEatingSoonTt.isChecked + val sendSMS = preferences.get(BooleanKey.SmsAllowRemoteCommands) && !phoneNumber.isNullOrBlank() if (insulinAfterConstraints > 0) { actions.add( @@ -207,6 +222,9 @@ class InsulinDialog : DialogFragmentWithDate() { ) if (recordOnlyChecked) actions.add(rh.gs(app.aaps.core.ui.R.string.bolus_recorded_only).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) + else if (sendSMS) + actions.add(rh.gs(app.aaps.core.ui.R.string.sms_bolus_notification).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) + if (abs(insulinAfterConstraints - insulin) > pumpDescription.pumpType.determineCorrectBolusStepSize(insulinAfterConstraints)) actions.add( rh.gs(app.aaps.core.ui.R.string.bolus_constraint_applied_warn, insulin, insulinAfterConstraints).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor) @@ -269,6 +287,8 @@ class InsulinDialog : DialogFragmentWithDate() { ).subscribe() if (timeOffset == 0) automation.removeAutomationEventBolusReminder() + } else if (sendSMS) { + smsCommunicator.sendSMS(Sms(phoneNumber, rh.gs(app.aaps.core.ui.R.string.bolus) + " " + detailedBolusInfo.insulin)) } else { uel.log( Action.BOLUS, Sources.InsulinDialog, diff --git a/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt b/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt index 8b40adcdf90..85bc8ab2480 100644 --- a/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/TreatmentDialog.kt @@ -23,9 +23,13 @@ import app.aaps.core.interfaces.pump.defs.determineCorrectBolusStepSize import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.resources.ResourceHelper +import app.aaps.core.interfaces.smsCommunicator.Sms +import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.SafeParse +import app.aaps.core.keys.BooleanKey +import app.aaps.core.keys.StringKey import app.aaps.core.objects.constraints.ConstraintObject import app.aaps.core.objects.extensions.formatColor import app.aaps.core.ui.dialogs.OKDialog @@ -44,6 +48,7 @@ import kotlin.math.abs class TreatmentDialog : DialogFragmentWithDate() { + @Inject lateinit var smsCommunicator: SmsCommunicator @Inject lateinit var constraintChecker: ConstraintsChecker @Inject lateinit var rh: ResourceHelper @Inject lateinit var activePlugin: ActivePlugin @@ -105,8 +110,11 @@ class TreatmentDialog : DialogFragmentWithDate() { super.onViewCreated(view, savedInstanceState) if (config.NSCLIENT) { - binding.recordOnly.isChecked = true - binding.recordOnly.isEnabled = false + if(preferences.get(BooleanKey.SmsAllowRemoteCommands)) { + binding.recordOnly.isChecked = preferences.get(StringKey.SmsReceiverNumber).isNullOrBlank() + } else { + binding.recordOnly.isChecked = true + } } val maxCarbs = constraintChecker.getMaxCarbsAllowed().value().toDouble() val maxInsulin = constraintChecker.getMaxBolusAllowed().value() @@ -141,10 +149,12 @@ class TreatmentDialog : DialogFragmentWithDate() { val pumpDescription = activePlugin.activePump.pumpDescription val insulin = SafeParse.stringToDouble(binding.insulin.text) val carbs = SafeParse.stringToInt(binding.carbs.text) + val phoneNumber = preferences.get(StringKey.SmsReceiverNumber) val recordOnlyChecked = binding.recordOnly.isChecked val actions: LinkedList = LinkedList() val insulinAfterConstraints = constraintChecker.applyBolusConstraints(ConstraintObject(insulin, aapsLogger)).value() val carbsAfterConstraints = constraintChecker.applyCarbsConstraints(ConstraintObject(carbs, aapsLogger)).value() + val sendSMS = preferences.get(BooleanKey.SmsAllowRemoteCommands) && !phoneNumber.isNullOrBlank() if (insulinAfterConstraints > 0) { actions.add( @@ -156,6 +166,13 @@ class TreatmentDialog : DialogFragmentWithDate() { ) if (recordOnlyChecked) actions.add(rh.gs(app.aaps.core.ui.R.string.bolus_recorded_only).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor)) + else if (sendSMS) + actions.add( + rh.gs( + app.aaps.core.ui.R.string.sms_bolus_notification + ).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor) + ) + if (abs(insulinAfterConstraints - insulin) > pumpDescription.pumpType.determineCorrectBolusStepSize(insulinAfterConstraints)) actions.add( rh.gs(app.aaps.core.ui.R.string.bolus_constraint_applied_warn, insulin, insulinAfterConstraints).formatColor(context, rh, app.aaps.core.ui.R.attr.warningColor) @@ -184,14 +201,17 @@ class TreatmentDialog : DialogFragmentWithDate() { detailedBolusInfo.insulin = insulinAfterConstraints detailedBolusInfo.carbs = carbsAfterConstraints.toDouble() detailedBolusInfo.context = context - if (recordOnlyChecked) { + if (recordOnlyChecked || sendSMS) { if (detailedBolusInfo.insulin > 0) - disposable += persistenceLayer.insertOrUpdateBolus( - bolus = detailedBolusInfo.createBolus(), - action = action, - source = Sources.TreatmentDialog, - note = if (insulinAfterConstraints != 0.0) rh.gs(app.aaps.core.ui.R.string.record) else "" - ).subscribe() + if (sendSMS) + smsCommunicator.sendSMS(Sms(phoneNumber, rh.gs(app.aaps.core.ui.R.string.bolus) + " " + detailedBolusInfo.insulin)) + else + disposable += persistenceLayer.insertOrUpdateBolus( + bolus = detailedBolusInfo.createBolus(), + action = action, + source = Sources.TreatmentDialog, + note = if (insulinAfterConstraints != 0.0) rh.gs(app.aaps.core.ui.R.string.record) else "" + ).subscribe() if (detailedBolusInfo.carbs > 0) disposable += persistenceLayer.insertOrUpdateCarbs( carbs = detailedBolusInfo.createCarbs(), @@ -249,4 +269,4 @@ class TreatmentDialog : DialogFragmentWithDate() { } } } -} \ No newline at end of file +}