diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt index 3e822177eb..d1ce90fc72 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt @@ -56,7 +56,7 @@ class VersionCheckerUtils @Inject constructor( } }.start() } else - aapsLogger.debug(LTag.CORE, "Github master version no checked. No connectivity") + aapsLogger.debug(LTag.CORE, "Github master version not checked. No connectivity") @Suppress("SameParameterValue") fun compareWithCurrentVersion(newVersion: String?, currentVersion: String) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 350e5f08db..c8a6bc8601 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -719,20 +719,28 @@ class SmsCommunicatorPlugin @Inject constructor( override fun run() { val detailedBolusInfo = DetailedBolusInfo() detailedBolusInfo.carbs = anInteger().toDouble() + detailedBolusInfo.source = Source.USER detailedBolusInfo.date = secondLong() - commandQueue.bolus(detailedBolusInfo, object : Callback() { - override fun run() { - if (result.success) { - var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger) - replyText += "\n" + activePlugin.activePump.shortStatus(true) - sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) - } else { - var replyText = resourceHelper.gs(R.string.smscommunicator_carbsfailed) - replyText += "\n" + activePlugin.activePump.shortStatus(true) - sendSMS(Sms(receivedSms.phoneNumber, replyText)) + if (activePlugin.activePump.pumpDescription.storesCarbInfo) { + commandQueue.bolus(detailedBolusInfo, object : Callback() { + override fun run() { + if (result.success) { + var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger) + replyText += "\n" + activePlugin.activePump.shortStatus(true) + sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) + } else { + var replyText = resourceHelper.gs(R.string.smscommunicator_carbsfailed) + replyText += "\n" + activePlugin.activePump.shortStatus(true) + sendSMS(Sms(receivedSms.phoneNumber, replyText)) + } } - } - }) + }) + } else { + activePlugin.activeTreatments.addToHistoryTreatment(detailedBolusInfo, true) + var replyText = String.format(resourceHelper.gs(R.string.smscommunicator_carbsset), anInteger) + replyText += "\n" + activePlugin.activePump.shortStatus(true) + sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) + } } }) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentService.java b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentService.java index 46c16e9772..a6207e595b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/TreatmentService.java @@ -281,6 +281,10 @@ public class TreatmentService extends OrmLiteBaseService { // return true if new record is created public UpdateReturn createOrUpdate(Treatment treatment) { + if (treatment != null && treatment.source == Source.NONE) { + log.error("Coder error: source is not set for treatment: " + treatment, new Exception()); + //FabricPrivacy.logException(new Exception("Coder error: source is not set for treatment: " + treatment)); + } try { Treatment old; treatment.date = DatabaseHelper.roundDateToSec(treatment.date); diff --git a/app/src/main/res/values-nl-rNL/objectives.xml b/app/src/main/res/values-nl-rNL/objectives.xml index c9e23d317a..613bcfa9e6 100644 --- a/app/src/main/res/values-nl-rNL/objectives.xml +++ b/app/src/main/res/values-nl-rNL/objectives.xml @@ -35,6 +35,7 @@ Inhoud van loop plugin weergeven Gebruik de schaalfunctie: houd de BG grafiek lang ingedrukt Enter + Als je ten minste 3 maanden closed loop ervaring hebt met een ander doe-het-zelf systeem dan kun je wellicht een code aanvragen om doelen over te slaan. Zie https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Objectives.html#doelen-overslaan voor details. Code geaccepteerd Code ongeldig Bewijs je kennis