From 67c53b412da29d6d8b32436445b24959bb94d4c8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 18 Oct 2021 21:55:09 +0200 Subject: [PATCH] fix safety carbs sync --- .../androidaps/plugins/constraints/safety/SafetyPlugin.kt | 4 ++-- .../info/nightscout/androidaps/setupwizard/SWDefinition.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index 473f92f080..e5652e31fa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -200,11 +200,11 @@ class SafetyPlugin @Inject constructor( JSONObject() .putString(R.string.key_age, sp, resourceHelper) .putDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper) - .putDouble(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) + .putInt(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) override fun applyConfiguration(configuration: JSONObject) { configuration.storeString(R.string.key_age, sp, resourceHelper) configuration.storeDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper) - configuration.storeDouble(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) + configuration.storeInt(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) } } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt index 55b52fe34d..a05a7685a2 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -235,7 +235,7 @@ class SWDefinition @Inject constructor( .validator { sp.contains(R.string.key_age) && sp.getDouble(R.string.key_treatmentssafety_maxbolus, 0.0) > 0 - && sp.getDouble(R.string.key_treatmentssafety_maxcarbs, 0.0) > 0 + && sp.getInt(R.string.key_treatmentssafety_maxcarbs, 0) > 0 } private val screenInsulin = SWScreen(injector, R.string.configbuilder_insulin) .skippable(false)