cleanup
This commit is contained in:
parent
89d2290ed9
commit
b025fea343
1 changed files with 10 additions and 34 deletions
|
@ -269,44 +269,20 @@ abstract class PumpPluginAbstract protected constructor(
|
||||||
ret += if (pumpStatusData.lastConnection == 0L) {
|
ret += if (pumpStatusData.lastConnection == 0L) {
|
||||||
"LastConn: never\n"
|
"LastConn: never\n"
|
||||||
} else {
|
} else {
|
||||||
val agoMsec = System.currentTimeMillis() - pumpStatusData.lastConnection
|
val agoMin = ((System.currentTimeMillis() - pumpStatusData.lastConnection) / 60.0 / 1000.0).toInt()
|
||||||
val agoMin = (agoMsec / 60.0 / 1000.0).toInt()
|
|
||||||
"LastConn: $agoMin min ago\n"
|
"LastConn: $agoMin min ago\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pumpStatusData.lastBolusTime?.time != 0L) {
|
pumpStatusData.lastBolusTime?.let {
|
||||||
ret += "LastBolus: ${to2Decimal(pumpStatusData.lastBolusAmount!!)}U @${DateFormat.format("HH:mm", pumpStatusData.lastBolusTime)}"
|
if (it.time != 0L) {
|
||||||
|
ret += "LastBolus: ${to2Decimal(pumpStatusData.lastBolusAmount!!)}U @${DateFormat.format("HH:mm", it)}\n"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val activeTemp = pumpSync.expectedPumpState().temporaryBasal
|
pumpSync.expectedPumpState().temporaryBasal?.let { ret += "Temp: ${it.toStringFull(dateUtil)}\n" }
|
||||||
if (activeTemp != null) {
|
pumpSync.expectedPumpState().extendedBolus?.let { ret += "Extended: ${it.toStringFull(dateUtil)}\n" }
|
||||||
ret += """
|
ret += "IOB: ${pumpStatusData.iob}U\n"
|
||||||
Temp: ${activeTemp.toStringFull(dateUtil)}
|
ret += "Reserv: ${to0Decimal(pumpStatusData.reservoirRemainingUnits)}U\n"
|
||||||
|
ret += "Batt: ${pumpStatusData.batteryRemaining}\n"
|
||||||
""".trimIndent()
|
|
||||||
}
|
|
||||||
val activeExtendedBolus = pumpSync.expectedPumpState().extendedBolus
|
|
||||||
if (activeExtendedBolus != null) {
|
|
||||||
ret += """
|
|
||||||
Extended: ${activeExtendedBolus.toStringFull(dateUtil)}
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
}
|
|
||||||
// if (!veryShort) {
|
|
||||||
// ret += "TDD: " + DecimalFormatter.to0Decimal(pumpStatus.dailyTotalUnits) + " / "
|
|
||||||
// + pumpStatus.maxDailyTotalUnits + " U\n";
|
|
||||||
// }
|
|
||||||
ret += """
|
|
||||||
IOB: ${pumpStatusData.iob}U
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
ret += """
|
|
||||||
Reserv: ${to0Decimal(pumpStatusData.reservoirRemainingUnits)}U
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
ret += """
|
|
||||||
Batt: ${pumpStatusData.batteryRemaining}
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue