From 22eb5245562567e3264cbb09580f16b7b1ce3517 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 7 Nov 2021 20:14:44 +0100 Subject: [PATCH] increase bg validity check red range to 20s --- .../plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index 9f7d3990dd..c20e5f3864 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -8,6 +8,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import io.reactivex.disposables.CompositeDisposable @@ -73,7 +74,7 @@ class BgQualityCheckPlugin @Inject constructor( val readings = iobCobCalculator.ads.getBgReadingsDataTableCopy() for (i in readings.indices) if (i < readings.size - 2) - if (abs(readings[i].timestamp - readings[i + 1].timestamp) <= 1000) { + if (abs(readings[i].timestamp - readings[i + 1].timestamp) <= T.secs(20).msecs()) { state = State.DOUBLED aapsLogger.debug(LTag.CORE, "BG similar. Turning on red state.\n${readings[i]}\n${readings[i+1]}") message = rh.gs(R.string.bg_too_close, readings[i].toString(), readings[i+1].toString())