From d9f68bca3fb89b1b8ffe89d9ade5e544e0e84e5d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 16 Nov 2021 23:50:28 +0100 Subject: [PATCH] Dana: fix disabling loop --- .../plugins/configBuilder/ConfigBuilderPlugin.kt | 15 ++------------- .../info/nightscout/androidaps/dana/DanaPump.kt | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index cf9a78194c..a6190167bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -56,7 +56,6 @@ class ConfigBuilderPlugin @Inject constructor( for (plugin in activePlugin.getPluginsList()) { if (plugin.pluginDescription.alwaysEnabled) plugin.setPluginEnabled(plugin.getType(), true) } - storeSettings("setAlwaysEnabledPluginsEnabled") } override fun storeSettings(from: String) { @@ -68,18 +67,13 @@ class ConfigBuilderPlugin @Inject constructor( if (p.pluginDescription.alwaysEnabled && p.pluginDescription.alwaysVisible) continue if (p.pluginDescription.alwaysEnabled && p.pluginDescription.neverVisible) continue savePref(p, type, true) - if (type == PluginType.PUMP) { - if (p is ProfileSource) { // Store state of optional Profile interface - savePref(p, PluginType.PROFILE, false) - } - } } } private fun savePref(p: PluginBase, type: PluginType, storeVisible: Boolean) { val settingEnabled = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Enabled" - sp.putBoolean(settingEnabled, p.isEnabled(type)) - aapsLogger.debug(LTag.CONFIGBUILDER, "Storing: " + settingEnabled + ":" + p.isEnabled(type)) + sp.putBoolean(settingEnabled, p.isEnabled()) + aapsLogger.debug(LTag.CONFIGBUILDER, "Storing: " + settingEnabled + ":" + p.isEnabled()) if (storeVisible) { val settingVisible = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Visible" sp.putBoolean(settingVisible, p.isFragmentVisible()) @@ -92,11 +86,6 @@ class ConfigBuilderPlugin @Inject constructor( for (p in activePlugin.getPluginsList()) { val type = p.getType() loadPref(p, type, true) - if (p.getType() == PluginType.PUMP) { - if (p is ProfileSource) { - loadPref(p, PluginType.PROFILE, false) - } - } } activePlugin.verifySelectionInCategories() } diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index 6f01ddff3d..ae2c263746 100644 --- a/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -444,7 +444,7 @@ class DanaPump @Inject constructor( 0x06 -> PumpType.DANA_RS_KOREAN 0x07 -> PumpType.DANA_I 0x09 -> PumpType.DANA_I - else -> PumpType.USER + else -> PumpType.DANA_RS // having here default type non TBR capable is causing problem with disabling loop } // v2, RS history entries