Rework tbr
This commit is contained in:
parent
68720cb2da
commit
9b2441f457
|
@ -327,8 +327,13 @@ class GarminPlugin @Inject constructor(
|
||||||
GlucoseUnit.MGDL -> jo.addProperty("units_hint", "mgdl")
|
GlucoseUnit.MGDL -> jo.addProperty("units_hint", "mgdl")
|
||||||
GlucoseUnit.MMOL -> jo.addProperty("units_hint", "mmol")
|
GlucoseUnit.MMOL -> jo.addProperty("units_hint", "mmol")
|
||||||
}
|
}
|
||||||
jo.addProperty("iob", loopHub.insulinTotalOnboard)
|
jo.addProperty("iob", loopHub.insulinOnboard + loopHub.insulinBasalOnboard)
|
||||||
jo.addProperty("tbr", loopHub.temporaryBasalPercent)
|
loopHub.temporaryBasal.also {
|
||||||
|
if (!it.isNaN()) {
|
||||||
|
val temporaryBasalRateInPercent = (it * 100.0).toInt()
|
||||||
|
jo.addProperty("tbr", temporaryBasalRateInPercent)
|
||||||
|
}
|
||||||
|
}
|
||||||
jo.addProperty("cob", loopHub.carbsOnboard)
|
jo.addProperty("cob", loopHub.carbsOnboard)
|
||||||
}
|
}
|
||||||
joa.add(jo)
|
joa.add(jo)
|
||||||
|
|
Loading…
Reference in a new issue