Poctech: fix unit conversion
This commit is contained in:
parent
67edb7a2fd
commit
4a899365db
1 changed files with 2 additions and 2 deletions
|
@ -70,8 +70,8 @@ class PoctechPlugin @Inject constructor(
|
|||
val json = jsonArray.getJSONObject(i)
|
||||
glucoseValues += CgmSourceTransaction.TransactionGlucoseValue(
|
||||
timestamp = json.getLong("date"),
|
||||
value = if (safeGetString(json, "units", Constants.MGDL) == "mmol/L") json.getDouble("current")
|
||||
else json.getDouble("current") * Constants.MMOLL_TO_MGDL,
|
||||
value = if (safeGetString(json, "units", Constants.MGDL) == "mmol/L") json.getDouble("current") * Constants.MMOLL_TO_MGDL
|
||||
else json.getDouble("current"),
|
||||
raw = json.getDouble("raw"),
|
||||
noise = null,
|
||||
trendArrow = GlucoseValue.TrendArrow.fromString(json.getString("direction")),
|
||||
|
|
Loading…
Reference in a new issue