From da9caa2b042579994018c3190b65f02af1ee4451 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 1 Feb 2022 18:48:31 +0100 Subject: [PATCH 1/4] NSClient: enable sync controls without engineering mode --- .../androidaps/plugins/general/nsclient/NSClientPlugin.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 968f6f4c61..540ce3e628 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 @@ -154,10 +154,10 @@ class NSClientPlugin @Inject constructor( // preferenceFragment.findPreference(rh.gs(R.string.key_ns_sync_use_absolute))?.isVisible = false } else { // APS or pumpControl mode - preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_profile_switch))?.isVisible = buildHelper.isEngineeringMode() - preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_insulin))?.isVisible = buildHelper.isEngineeringMode() - preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_carbs))?.isVisible = buildHelper.isEngineeringMode() - preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_temp_target))?.isVisible = buildHelper.isEngineeringMode() +// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_profile_switch))?.isVisible = buildHelper.isEngineeringMode() +// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_insulin))?.isVisible = buildHelper.isEngineeringMode() +// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_carbs))?.isVisible = buildHelper.isEngineeringMode() +// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_temp_target))?.isVisible = buildHelper.isEngineeringMode() } } From 53ee64f6e1f19687c22e16d24dad7d89b7515056 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 1 Feb 2022 18:49:39 +0100 Subject: [PATCH 2/4] bump 3.0.0.1 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 95015be617..e94c3d61ef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -109,7 +109,7 @@ android { defaultConfig { multiDexEnabled true versionCode 1500 - version "3.0.0" + version "3.0.0.1" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' From ebc0c5b8365787eb1fbda94a8091a91d08685b9a Mon Sep 17 00:00:00 2001 From: Andries Smit Date: Tue, 1 Feb 2022 19:45:57 +0100 Subject: [PATCH 3/4] Feat: hide insulin age for omnipod --- .../plugins/general/overview/StatusLightHandler.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 8338645de3..61e632306b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview import android.graphics.Color +import android.view.View import android.widget.TextView import androidx.annotation.StringRes import info.nightscout.androidaps.R @@ -39,7 +40,12 @@ class StatusLightHandler @Inject constructor( val pump = activePlugin.activePump val bgSource = activePlugin.activeBgSource handleAge(careportal_cannula_age, TherapyEvent.Type.CANNULA_CHANGE, R.string.key_statuslights_cage_warning, 48.0, R.string.key_statuslights_cage_critical, 72.0) - handleAge(careportal_insulin_age, TherapyEvent.Type.INSULIN_CHANGE, R.string.key_statuslights_iage_warning, 72.0, R.string.key_statuslights_iage_critical, 144.0) + if (pump.model() == PumpType.OMNIPOD_EROS || pump.model() == PumpType.OMNIPOD_DASH) { + careportal_insulin_age?.visibility = View.GONE + } else { + careportal_insulin_age?.visibility = View.VISIBLE + handleAge(careportal_insulin_age, TherapyEvent.Type.INSULIN_CHANGE, R.string.key_statuslights_iage_warning, 72.0, R.string.key_statuslights_iage_critical, 144.0) + } handleAge(careportal_sensor_age, TherapyEvent.Type.SENSOR_CHANGE, R.string.key_statuslights_sage_warning, 216.0, R.string.key_statuslights_sage_critical, 240.0) if (pump.pumpDescription.isBatteryReplaceable || (pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel && pump.isBatteryChangeLoggingEnabled)) { handleAge(careportal_pb_age, TherapyEvent.Type.PUMP_BATTERY_CHANGE, R.string.key_statuslights_bage_warning, 216.0, R.string.key_statuslights_bage_critical, 240.0) From 479bfc41030bf876528a53ec9a5124b224ae86a0 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 1 Feb 2022 21:55:55 +0100 Subject: [PATCH 4/4] NSClient: enable sync controls without engineering mode #2 --- .../general/nsclient/NSClientAddUpdateWorker.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 8ddd44b31a..78f69cf5de 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 @@ -75,7 +75,7 @@ class NSClientAddUpdateWorker( if (mills > latestDateInReceivedData) latestDateInReceivedData = mills if (insulin > 0) { - if (sp.getBoolean(R.string.key_ns_receive_insulin, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + if (sp.getBoolean(R.string.key_ns_receive_insulin, false) || config.NSCLIENT) { bolusFromJson(json)?.let { bolus -> repository.runTransactionForResult(SyncNsBolusTransaction(bolus)) .doOnError { @@ -109,7 +109,7 @@ class NSClientAddUpdateWorker( } } if (carbs > 0) { - if (sp.getBoolean(R.string.key_ns_receive_carbs, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + if (sp.getBoolean(R.string.key_ns_receive_carbs, false) || config.NSCLIENT) { carbsFromJson(json)?.let { carb -> repository.runTransactionForResult(SyncNsCarbsTransaction(carb)) .doOnError { @@ -159,7 +159,7 @@ class NSClientAddUpdateWorker( when { insulin > 0 || carbs > 0 -> Any() eventType == TherapyEvent.Type.TEMPORARY_TARGET.text -> - if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) || config.NSCLIENT) { temporaryTargetFromJson(json)?.let { temporaryTarget -> repository.runTransactionForResult(SyncNsTemporaryTargetTransaction(temporaryTarget)) .doOnError { @@ -205,7 +205,7 @@ class NSClientAddUpdateWorker( } ?: aapsLogger.error("Error parsing TT json $json") } eventType == TherapyEvent.Type.NOTE.text && json.isEffectiveProfileSwitch() -> // replace this by new Type when available in NS - if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { effectiveProfileSwitchFromJson(json, dateUtil)?.let { effectiveProfileSwitch -> repository.runTransactionForResult(SyncNsEffectiveProfileSwitchTransaction(effectiveProfileSwitch)) .doOnError { @@ -399,7 +399,7 @@ class NSClientAddUpdateWorker( } ?: aapsLogger.error("Error parsing TemporaryBasal json $json") } eventType == TherapyEvent.Type.PROFILE_SWITCH.text -> - if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { profileSwitchFromJson(json, dateUtil, activePlugin)?.let { profileSwitch -> repository.runTransactionForResult(SyncNsProfileSwitchTransaction(profileSwitch)) .doOnError {