NSBgSource: store raw only if provided
This commit is contained in:
parent
180d9327b6
commit
b8880c3585
1 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ class NSClientSourcePlugin @Inject constructor(
|
||||||
timestamp = sgv.mills ?: return null,
|
timestamp = sgv.mills ?: return null,
|
||||||
value = sgv.mgdl?.toDouble() ?: return null,
|
value = sgv.mgdl?.toDouble() ?: return null,
|
||||||
noise = null,
|
noise = null,
|
||||||
raw = sgv.filtered?.toDouble() ?: sgv.mgdl?.toDouble(),
|
raw = sgv.filtered?.toDouble(),
|
||||||
trendArrow = GlucoseValue.TrendArrow.fromString(sgv.direction),
|
trendArrow = GlucoseValue.TrendArrow.fromString(sgv.direction),
|
||||||
nightscoutId = sgv.id,
|
nightscoutId = sgv.id,
|
||||||
sourceSensor = GlucoseValue.SourceSensor.fromString(sgv.device)
|
sourceSensor = GlucoseValue.SourceSensor.fromString(sgv.device)
|
||||||
|
@ -123,7 +123,7 @@ class NSClientSourcePlugin @Inject constructor(
|
||||||
timestamp = sgv.date,
|
timestamp = sgv.date,
|
||||||
value = sgv.sgv,
|
value = sgv.sgv,
|
||||||
noise = sgv.noise?.toDouble(),
|
noise = sgv.noise?.toDouble(),
|
||||||
raw = sgv.filtered ?: sgv.sgv,
|
raw = sgv.filtered,
|
||||||
trendArrow = GlucoseValue.TrendArrow.fromString(sgv.direction.nsName),
|
trendArrow = GlucoseValue.TrendArrow.fromString(sgv.direction.nsName),
|
||||||
nightscoutId = sgv.identifier,
|
nightscoutId = sgv.identifier,
|
||||||
sourceSensor = GlucoseValue.SourceSensor.fromString(sgv.device),
|
sourceSensor = GlucoseValue.SourceSensor.fromString(sgv.device),
|
||||||
|
|
Loading…
Reference in a new issue