MDT TBR fix
This commit is contained in:
parent
a2c7f2a6d9
commit
0b102376c6
|
@ -631,6 +631,11 @@ class MedtronicHistoryData @Inject constructor(
|
|||
"pumpId=${tempBasalProcessDTO.pumpId}, pumpType=${medtronicPumpStatus.pumpType}, " +
|
||||
"pumpSerial=${medtronicPumpStatus.serialNumber}]")
|
||||
|
||||
|
||||
if (tempBasalProcessDTO.durationAsSeconds == 0) {
|
||||
rxBus.send(EventNewNotification(Notification(Notification.MDT_INVALID_HISTORY_DATA, rh.gs(R.string.invalid_history_data), Notification.URGENT)))
|
||||
aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithPumpId - Skipped")
|
||||
} else {
|
||||
val result = pumpSync.syncTemporaryBasalWithTempId(
|
||||
tryToGetByLocalTime(tempBasalProcessDTO.atechDateTime),
|
||||
tbrEntry.insulinRate,
|
||||
|
@ -640,9 +645,11 @@ class MedtronicHistoryData @Inject constructor(
|
|||
PumpSync.TemporaryBasalType.NORMAL,
|
||||
tempBasalProcessDTO.pumpId,
|
||||
medtronicPumpStatus.pumpType,
|
||||
medtronicPumpStatus.serialNumber)
|
||||
medtronicPumpStatus.serialNumber
|
||||
)
|
||||
|
||||
aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithTempId - Result: $result")
|
||||
}
|
||||
|
||||
pumpSyncStorage.removeTemporaryBasalWithTemporaryId(entryWithTempId.temporaryId)
|
||||
tbrRecords.remove(entryWithTempId)
|
||||
|
|
Loading…
Reference in a new issue