From d9c066a8597cddd55a1426d5c247931ac41fd0a7 Mon Sep 17 00:00:00 2001 From: Philoul Date: Tue, 14 Sep 2021 21:47:13 +0200 Subject: [PATCH] Fix ProfileSealed Target out of Hardlimit --- .../java/info/nightscout/androidaps/data/ProfileSealed.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index f47f1a534f..93d863aaee 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -161,7 +161,7 @@ sealed class ProfileSealed( break } for (target in targetBlocks) { - if (hardLimits.isInRange( + if (!hardLimits.isInRange( Round.roundTo(target.lowTarget, 0.1), HardLimits.VERY_HARD_LIMIT_MIN_BG[0].toDouble(), HardLimits.VERY_HARD_LIMIT_MIN_BG[1].toDouble() @@ -171,7 +171,7 @@ sealed class ProfileSealed( validityCheck.reasons.add(resourceHelper.gs(R.string.value_out_of_hard_limits, resourceHelper.gs(R.string.profile_low_target), target.lowTarget)) break } - if (hardLimits.isInRange( + if (!hardLimits.isInRange( Round.roundTo(target.highTarget, 0.1), HardLimits.VERY_HARD_LIMIT_MAX_BG[0].toDouble(), HardLimits.VERY_HARD_LIMIT_MAX_BG[1].toDouble()