diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt index 78f69cf5de..7c01449ba6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt @@ -310,7 +310,7 @@ class NSClientAddUpdateWorker( } ?: aapsLogger.error("Error parsing TherapyEvent json $json") } eventType == TherapyEvent.Type.COMBO_BOLUS.text -> - if (config.NSCLIENT) { + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { extendedBolusFromJson(json)?.let { extendedBolus -> repository.runTransactionForResult(SyncNsExtendedBolusTransaction(extendedBolus)) .doOnError { @@ -356,7 +356,7 @@ class NSClientAddUpdateWorker( } ?: aapsLogger.error("Error parsing ExtendedBolus json $json") } eventType == TherapyEvent.Type.TEMPORARY_BASAL.text -> - if (config.NSCLIENT) { + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { temporaryBasalFromJson(json)?.let { temporaryBasal -> repository.runTransactionForResult(SyncNsTemporaryBasalTransaction(temporaryBasal)) .doOnError { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt index 74b0f897a6..a7bd08ad47 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt @@ -151,6 +151,7 @@ class NSClientPlugin @Inject constructor( preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_errors))?.isVisible = false preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_carbs_req))?.isVisible = false + preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_tbr_eb))?.isVisible = buildHelper.isEngineeringMode() // preferenceFragment.findPreference(rh.gs(R.string.key_ns_sync_use_absolute))?.isVisible = false } else { // APS or pumpControl mode diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9ec8c6ec2a..07bf55f635 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1110,6 +1110,8 @@ Accept profile switches entered through NS or NSClient Receive APS offline events Accept APS Offline events entered through NS or NSClient + Receive TBR and EB + Accept TBR and EB entered through another instance ns_receive_insulin Receive insulin Accept insulin entered through NS or NSClient (it\'s not delivered, only calculated towards IOB) @@ -1117,6 +1119,7 @@ Receive carbs Accept carbs entered through NS or NSClient ns_receive_therapy_events + ns_receive_tbr_eb Receive therapy events Accept therapy events (cannula, insulin, battery change etc) entered through NS or NSClient ns_receive_cgm diff --git a/app/src/main/res/xml/pref_nsclientinternal.xml b/app/src/main/res/xml/pref_nsclientinternal.xml index 208bb66168..9d9aca0133 100644 --- a/app/src/main/res/xml/pref_nsclientinternal.xml +++ b/app/src/main/res/xml/pref_nsclientinternal.xml @@ -84,6 +84,12 @@ android:summary="@string/ns_receive_offline_event_summary" android:title="@string/ns_receive_offline_event" /> + + >