Update basal profile precision handling in Insight driver

This commit is contained in:
Tebbe Ubben 2019-03-31 19:36:58 +02:00
parent 3894e44cc7
commit 78a3224d05

View file

@ -476,7 +476,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
nextValue = profile.getBasalValues()[i + 1];
if (profileBlock.getDuration() * 60 != (nextValue != null ? nextValue.timeAsSeconds : 24 * 60 * 60) - basalValue.timeAsSeconds)
return false;
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) > (basalValue.value > 5 ? 0.1 : 0.01))
if (Math.abs(profileBlock.getBasalAmount() - basalValue.value) >= (profileBlock.getBasalAmount() >= 5 ? 0.1 : 0.01))
return false;
}
return true;