Xdrip: round incomming b values

This commit is contained in:
Milos Kozak 2023-11-12 11:08:48 +01:00
parent f519d37ac3
commit 3e681ef219

View file

@ -22,6 +22,7 @@ import dagger.android.HasAndroidInjector
import kotlinx.coroutines.Dispatchers
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.math.round
@Singleton
class XdripSourcePlugin @Inject constructor(
@ -76,8 +77,8 @@ class XdripSourcePlugin @Inject constructor(
val glucoseValues = mutableListOf<TransactionGlucoseValue>()
glucoseValues += TransactionGlucoseValue(
timestamp = bundle.getLong(Intents.EXTRA_TIMESTAMP, 0),
value = bundle.getDouble(Intents.EXTRA_BG_ESTIMATE, 0.0),
raw = bundle.getDouble(Intents.EXTRA_RAW, 0.0),
value = round(bundle.getDouble(Intents.EXTRA_BG_ESTIMATE, 0.0)),
raw = round(bundle.getDouble(Intents.EXTRA_RAW, 0.0)),
noise = null,
trendArrow = GlucoseValue.TrendArrow.fromString(bundle.getString(Intents.EXTRA_BG_SLOPE_NAME)),
sourceSensor = GlucoseValue.SourceSensor.fromString(