Fix displaying adjusted target

This commit is contained in:
Milos Kozak 2023-11-02 22:22:21 +01:00
parent bfacfd9255
commit 2e8dd257c6

View file

@ -966,7 +966,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
// If the target is not the same as set in the profile then oref has overridden it
val targetUsed =
if (config.APS) loop.lastRun?.constraintsProcessed?.targetBG ?: 0.0
else if (config.NSCLIENT) JsonHelper.safeGetDouble(processedDeviceStatusData.getAPSResult().json, "targetBg")
else if (config.NSCLIENT) JsonHelper.safeGetDouble(processedDeviceStatusData.getAPSResult().json, "targetBG")
else 0.0
if (targetUsed != 0.0 && abs(profile.getTargetMgdl() - targetUsed) > 0.01) {