Xdrip: round incomming b values
This commit is contained in:
parent
f519d37ac3
commit
3e681ef219
|
@ -22,6 +22,7 @@ import dagger.android.HasAndroidInjector
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
import kotlin.math.round
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class XdripSourcePlugin @Inject constructor(
|
class XdripSourcePlugin @Inject constructor(
|
||||||
|
@ -76,8 +77,8 @@ class XdripSourcePlugin @Inject constructor(
|
||||||
val glucoseValues = mutableListOf<TransactionGlucoseValue>()
|
val glucoseValues = mutableListOf<TransactionGlucoseValue>()
|
||||||
glucoseValues += TransactionGlucoseValue(
|
glucoseValues += TransactionGlucoseValue(
|
||||||
timestamp = bundle.getLong(Intents.EXTRA_TIMESTAMP, 0),
|
timestamp = bundle.getLong(Intents.EXTRA_TIMESTAMP, 0),
|
||||||
value = bundle.getDouble(Intents.EXTRA_BG_ESTIMATE, 0.0),
|
value = round(bundle.getDouble(Intents.EXTRA_BG_ESTIMATE, 0.0)),
|
||||||
raw = bundle.getDouble(Intents.EXTRA_RAW, 0.0),
|
raw = round(bundle.getDouble(Intents.EXTRA_RAW, 0.0)),
|
||||||
noise = null,
|
noise = null,
|
||||||
trendArrow = GlucoseValue.TrendArrow.fromString(bundle.getString(Intents.EXTRA_BG_SLOPE_NAME)),
|
trendArrow = GlucoseValue.TrendArrow.fromString(bundle.getString(Intents.EXTRA_BG_SLOPE_NAME)),
|
||||||
sourceSensor = GlucoseValue.SourceSensor.fromString(
|
sourceSensor = GlucoseValue.SourceSensor.fromString(
|
||||||
|
|
Loading…
Reference in a new issue