From e5319cc0f543c321fd8a28e0361c2de27248f62d Mon Sep 17 00:00:00 2001 From: mushroom-dev Date: Tue, 10 Dec 2024 21:25:25 +0100 Subject: [PATCH] compilation fix --- .../main/general/smsCommunicator/SmsCommunicatorPlugin.kt | 2 +- ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 6ce0c81854e..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,7 +933,7 @@ 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() + iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended()).round() + 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, iob) 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 c3b047befc7..58df02788ad 100644 --- a/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/kotlin/app/aaps/ui/dialogs/InsulinDialog.kt @@ -130,7 +130,8 @@ class InsulinDialog : DialogFragmentWithDate() { val pump = activePlugin.activePump if (config.NSCLIENT) { - // If SmsAllowRemoteCommands is True, then user might use either SMS command or record only, otherwise hardcode record_only option + // 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()