fix interval cutting during pump sync
This commit is contained in:
parent
7ed9616df3
commit
d520c45aba
|
@ -32,6 +32,7 @@ class SyncPumpExtendedBolusTransaction(private val extendedBolus: ExtendedBolus)
|
|||
val pctRun = (extendedBolus.timestamp - running.timestamp) / running.duration.toDouble()
|
||||
running.amount /= pctRun
|
||||
running.end = extendedBolus.timestamp
|
||||
running.interfaceIDs.endId = extendedBolus.interfaceIDs.pumpId
|
||||
database.extendedBolusDao.updateExistingEntry(running)
|
||||
result.updated.add(running)
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ class SyncPumpTemporaryBasalTransaction(
|
|||
val running = database.temporaryBasalDao.getTemporaryBasalActiveAt(temporaryBasal.timestamp, temporaryBasal.interfaceIDs.pumpType!!, temporaryBasal.interfaceIDs.pumpSerial!!).blockingGet()
|
||||
if (running != null) {
|
||||
running.end = temporaryBasal.timestamp
|
||||
running.interfaceIDs.endId = temporaryBasal.interfaceIDs.pumpId
|
||||
database.temporaryBasalDao.updateExistingEntry(running)
|
||||
result.updated.add(running)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue