This commit is contained in:
Milos Kozak 2021-11-16 21:40:47 +01:00
parent 9a2d254365
commit fb9871507b
5 changed files with 43 additions and 50 deletions

View file

@ -61,6 +61,8 @@ import org.joda.time.LocalDateTime
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
import kotlin.math.abs
import kotlin.math.floor
/** /**
* Created by andy on 23.04.18. * Created by andy on 23.04.18.
@ -125,7 +127,7 @@ class MedtronicPumpPlugin @Inject constructor(
rileyLinkMedtronicService = mLocalBinder.serviceInstance rileyLinkMedtronicService = mLocalBinder.serviceInstance
isServiceSet = true isServiceSet = true
rileyLinkMedtronicService.verifyConfiguration() rileyLinkMedtronicService.verifyConfiguration()
Thread(Runnable { Thread {
for (i in 0..19) { for (i in 0..19) {
SystemClock.sleep(5000) SystemClock.sleep(5000)
aapsLogger.debug(LTag.PUMP, "Starting Medtronic-RileyLink service") aapsLogger.debug(LTag.PUMP, "Starting Medtronic-RileyLink service")
@ -133,7 +135,7 @@ class MedtronicPumpPlugin @Inject constructor(
break break
} }
} }
}).start() }.start()
} }
} }
super.onStart() super.onStart()
@ -156,7 +158,7 @@ class MedtronicPumpPlugin @Inject constructor(
medtronicPumpStatus.previousConnection = medtronicPumpStatus.lastConnection medtronicPumpStatus.previousConnection = medtronicPumpStatus.lastConnection
//if (rileyLinkMedtronicService != null) rileyLinkMedtronicService.verifyConfiguration(); //if (rileyLinkMedtronicService != null) rileyLinkMedtronicService.verifyConfiguration();
aapsLogger.debug(LTag.PUMP, "initPumpStatusData: " + medtronicPumpStatus) aapsLogger.debug(LTag.PUMP, "initPumpStatusData: $medtronicPumpStatus")
// this is only thing that can change, by being configured // this is only thing that can change, by being configured
pumpDescription.maxTempAbsolute = if (medtronicPumpStatus.maxBasal != null) medtronicPumpStatus.maxBasal!! else 35.0 pumpDescription.maxTempAbsolute = if (medtronicPumpStatus.maxBasal != null) medtronicPumpStatus.maxBasal!! else 35.0
@ -192,13 +194,14 @@ class MedtronicPumpPlugin @Inject constructor(
override fun onStartCustomActions() { override fun onStartCustomActions() {
// check status every minute (if any status needs refresh we send readStatus command) // check status every minute (if any status needs refresh we send readStatus command)
Thread(Runnable { Thread {
do { do {
SystemClock.sleep(60000) SystemClock.sleep(60000)
if (this.isInitialized) { if (this.isInitialized) {
val statusRefresh = workWithStatusRefresh( val statusRefresh = workWithStatusRefresh(
StatusRefreshAction.GetData, null, null)!! StatusRefreshAction.GetData, null, null
if (doWeHaveAnyStatusNeededRefereshing(statusRefresh)) { )!!
if (doWeHaveAnyStatusNeededRefreshing(statusRefresh)) {
if (!commandQueue.statusInQueue()) { if (!commandQueue.statusInQueue()) {
commandQueue.readStatus("Scheduled Status Refresh", null) commandQueue.readStatus("Scheduled Status Refresh", null)
} }
@ -206,7 +209,7 @@ class MedtronicPumpPlugin @Inject constructor(
clearBusyQueue() clearBusyQueue()
} }
} while (serviceRunning) } while (serviceRunning)
}).start() }.start()
} }
override val serviceClass: Class<*> override val serviceClass: Class<*>
@ -333,7 +336,7 @@ class MedtronicPumpPlugin @Inject constructor(
private fun refreshAnyStatusThatNeedsToBeRefreshed() { private fun refreshAnyStatusThatNeedsToBeRefreshed() {
val statusRefresh = workWithStatusRefresh(StatusRefreshAction.GetData, null, val statusRefresh = workWithStatusRefresh(StatusRefreshAction.GetData, null,
null)!! null)!!
if (!doWeHaveAnyStatusNeededRefereshing(statusRefresh)) { if (!doWeHaveAnyStatusNeededRefreshing(statusRefresh)) {
return return
} }
var resetTime = false var resetTime = false
@ -387,7 +390,7 @@ class MedtronicPumpPlugin @Inject constructor(
if (resetTime) medtronicPumpStatus.setLastCommunicationToNow() if (resetTime) medtronicPumpStatus.setLastCommunicationToNow()
} }
private fun doWeHaveAnyStatusNeededRefereshing(statusRefresh: Map<MedtronicStatusRefreshType, Long>): Boolean { private fun doWeHaveAnyStatusNeededRefreshing(statusRefresh: Map<MedtronicStatusRefreshType, Long>): Boolean {
for ((_, value) in statusRefresh) { for ((_, value) in statusRefresh) {
if (value > 0 && System.currentTimeMillis() > value) { if (value > 0 && System.currentTimeMillis() > value) {
return true return true
@ -445,7 +448,7 @@ class MedtronicPumpPlugin @Inject constructor(
basalProfiles basalProfiles
val errorCount = rileyLinkMedtronicService.medtronicUIComm.invalidResponsesCount val errorCount = rileyLinkMedtronicService.medtronicUIComm.invalidResponsesCount
if (errorCount >= 5) { if (errorCount >= 5) {
aapsLogger.error("Number of error counts was 5 or more. Starting tunning.") aapsLogger.error("Number of error counts was 5 or more. Starting tuning.")
setRefreshButtonEnabled(true) setRefreshButtonEnabled(true)
serviceTaskExecutor.startTask(WakeAndTuneTask(injector)) serviceTaskExecutor.startTask(WakeAndTuneTask(injector))
return true return true
@ -471,7 +474,7 @@ class MedtronicPumpPlugin @Inject constructor(
@Synchronized @Synchronized
override fun isThisProfileSet(profile: Profile): Boolean { override fun isThisProfileSet(profile: Profile): Boolean {
aapsLogger.debug(LTag.PUMP, "isThisProfileSet: basalInitalized=" + medtronicPumpStatus.basalProfileStatus) aapsLogger.debug(LTag.PUMP, "isThisProfileSet: basalInitialized=" + medtronicPumpStatus.basalProfileStatus)
if (!isInitialized) return true if (!isInitialized) return true
if (medtronicPumpStatus.basalProfileStatus === BasalProfileStatus.NotInitialized) { if (medtronicPumpStatus.basalProfileStatus === BasalProfileStatus.NotInitialized) {
// this shouldn't happen, but if there was problem we try again // this shouldn't happen, but if there was problem we try again
@ -561,7 +564,7 @@ class MedtronicPumpPlugin @Inject constructor(
clock = medtronicUtil.pumpTime clock = medtronicUtil.pumpTime
} }
if (clock == null) return if (clock == null) return
val timeDiff = Math.abs(clock.timeDifference) val timeDiff = abs(clock.timeDifference)
if (timeDiff > 20) { if (timeDiff > 20) {
if (clock.localDeviceTime.year <= 2015 || timeDiff <= 24 * 60 * 60) { if (clock.localDeviceTime.year <= 2015 || timeDiff <= 24 * 60 * 60) {
aapsLogger.info(LTag.PUMP, String.format(Locale.ENGLISH, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is %d s. Set time on pump.", timeDiff)) aapsLogger.info(LTag.PUMP, String.format(Locale.ENGLISH, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference is %d s. Set time on pump.", timeDiff))
@ -597,12 +600,12 @@ class MedtronicPumpPlugin @Inject constructor(
bolusDeliveryType = BolusDeliveryType.DeliveryPrepared bolusDeliveryType = BolusDeliveryType.DeliveryPrepared
if (isPumpNotReachable) { if (isPumpNotReachable) {
aapsLogger.debug(LTag.PUMP, "MedtronicPumpPlugin::deliverBolus - Pump Unreachable.") aapsLogger.debug(LTag.PUMP, "MedtronicPumpPlugin::deliverBolus - Pump Unreachable.")
return setNotReachable(true, false) return setNotReachable(isBolus = true, success = false)
} }
medtronicUtil.dismissNotification(MedtronicNotificationType.PumpUnreachable, rxBus) medtronicUtil.dismissNotification(MedtronicNotificationType.PumpUnreachable, rxBus)
if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) { if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) {
// LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled."); // LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled.");
return setNotReachable(true, true) return setNotReachable(isBolus = true, success = true)
} }
// LOG.debug("MedtronicPumpPlugin::deliverBolus - Starting wait period."); // LOG.debug("MedtronicPumpPlugin::deliverBolus - Starting wait period.");
@ -610,7 +613,7 @@ class MedtronicPumpPlugin @Inject constructor(
SystemClock.sleep(sleepTime.toLong()) SystemClock.sleep(sleepTime.toLong())
return if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) { return if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) {
// LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled, before wait period."); // LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled, before wait period.");
setNotReachable(true, true) setNotReachable(isBolus = true, success = true)
} else try { } else try {
bolusDeliveryType = BolusDeliveryType.Delivering bolusDeliveryType = BolusDeliveryType.Delivering
@ -629,10 +632,10 @@ class MedtronicPumpPlugin @Inject constructor(
} else { } else {
if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) { if (bolusDeliveryType == BolusDeliveryType.CancelDelivery) {
// LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled after Bolus started."); // LOG.debug("MedtronicPumpPlugin::deliverBolus - Delivery Canceled after Bolus started.");
Thread(Runnable { Thread {
SystemClock.sleep(2000) SystemClock.sleep(2000)
runAlarm(context, rh.gs(R.string.medtronic_cmd_cancel_bolus_not_supported), rh.gs(R.string.medtronic_warning), R.raw.boluserror) runAlarm(context, rh.gs(R.string.medtronic_cmd_cancel_bolus_not_supported), rh.gs(R.string.medtronic_warning), R.raw.boluserror)
}).start() }.start()
} }
val now = System.currentTimeMillis() val now = System.currentTimeMillis()
detailedBolusInfo.timestamp = now detailedBolusInfo.timestamp = now
@ -662,6 +665,7 @@ class MedtronicPumpPlugin @Inject constructor(
// LOG.debug("MedtronicPumpPlugin::deliverBolus - End wait period. Start delivery"); // LOG.debug("MedtronicPumpPlugin::deliverBolus - End wait period. Start delivery");
} }
@Suppress("SameParameterValue")
private fun setNotReachable(isBolus: Boolean, success: Boolean): PumpEnactResult { private fun setNotReachable(isBolus: Boolean, success: Boolean): PumpEnactResult {
setRefreshButtonEnabled(true) setRefreshButtonEnabled(true)
if (isBolus) { if (isBolus) {
@ -786,12 +790,12 @@ class MedtronicPumpPlugin @Inject constructor(
var item : PumpDbEntryTBR? = null var item : PumpDbEntryTBR? = null
if (tbrs.size==1) { if (tbrs.size==1) {
item = tbrs.get(0); item = tbrs[0]
} else { } else {
for (tbr in tbrs) { for (tbr in tbrs) {
if (tbr.date == medtronicPumpStatus.runningTBRWithTemp!!.date) { if (tbr.date == medtronicPumpStatus.runningTBRWithTemp!!.date) {
item = tbr item = tbr
break; break
} }
} }
} }
@ -909,7 +913,7 @@ class MedtronicPumpPlugin @Inject constructor(
} else { // all other reads } else { // all other reads
if (debugHistory) aapsLogger.debug(LTag.PUMP, logPrefix + "readPumpHistoryLogic(): lastPumpHistoryEntry: not null - " + medtronicUtil.gsonInstance.toJson(lastPumpHistoryEntry)) if (debugHistory) aapsLogger.debug(LTag.PUMP, logPrefix + "readPumpHistoryLogic(): lastPumpHistoryEntry: not null - " + medtronicUtil.gsonInstance.toJson(lastPumpHistoryEntry))
medtronicHistoryData.setIsInInit(false) medtronicHistoryData.setIsInInit(false)
// we need to read 35 minutes in the past so that we can repair any TBR or Bolus values if neeeded // we need to read 35 minutes in the past so that we can repair any TBR or Bolus values if needed
targetDate = LocalDateTime(DateTimeUtil.getMillisFromATDWithAddedMinutes(lastPumpHistoryEntry!!.atechDateTime, -35)) targetDate = LocalDateTime(DateTimeUtil.getMillisFromATDWithAddedMinutes(lastPumpHistoryEntry!!.atechDateTime, -35))
} }
@ -930,7 +934,7 @@ class MedtronicPumpPlugin @Inject constructor(
medtronicHistoryData.addNewHistory(historyResult) medtronicHistoryData.addNewHistory(historyResult)
medtronicHistoryData.filterNewEntries() medtronicHistoryData.filterNewEntries()
// determine if first run, if yes detrmine how much of update do we need // determine if first run, if yes determine how much of update do we need
// - first run: // - first run:
// - get last history entry // - get last history entry
// - if not there download 1.5 days of data // - if not there download 1.5 days of data
@ -965,12 +969,11 @@ class MedtronicPumpPlugin @Inject constructor(
} }
} }
private fun scheduleNextRefresh(refreshType: MedtronicStatusRefreshType?, additionalTimeInMinutes: Int = 0) { private fun scheduleNextRefresh(refreshType: MedtronicStatusRefreshType, additionalTimeInMinutes: Int = 0) {
when (refreshType) { when (refreshType) {
MedtronicStatusRefreshType.RemainingInsulin -> { MedtronicStatusRefreshType.RemainingInsulin -> {
val remaining = medtronicPumpStatus.reservoirRemainingUnits val remaining = medtronicPumpStatus.reservoirRemainingUnits
val min: Int val min: Int = if (remaining > 50) 4 * 60 else if (remaining > 20) 60 else 15
min = if (remaining > 50) 4 * 60 else if (remaining > 20) 60 else 15
workWithStatusRefresh(StatusRefreshAction.Add, refreshType, getTimeInFutureFromMinutes(min)) workWithStatusRefresh(StatusRefreshAction.Add, refreshType, getTimeInFutureFromMinutes(min))
} }
@ -1049,7 +1052,7 @@ class MedtronicPumpPlugin @Inject constructor(
return PumpEnactResult(injector).success(true).enacted(false) return PumpEnactResult(injector).success(true).enacted(false)
} }
} else { } else {
aapsLogger.warn(LTag.PUMP, logPrefix + "cancelTempBasal - Could not read currect TBR, canceling operation.") aapsLogger.warn(LTag.PUMP, logPrefix + "cancelTempBasal - Could not read current TBR, canceling operation.")
finishAction("TBR") finishAction("TBR")
return PumpEnactResult(injector).success(false).enacted(false) return PumpEnactResult(injector).success(false).enacted(false)
.comment(R.string.medtronic_cmd_cant_read_tbr) .comment(R.string.medtronic_cmd_cant_read_tbr)
@ -1082,7 +1085,7 @@ class MedtronicPumpPlugin @Inject constructor(
runningTBR.pumpType, runningTBR.pumpType,
runningTBR.serialNumber) runningTBR.serialNumber)
val differenceTimeMin = Math.floor(differenceTime / (60.0 * 1000.0)) val differenceTimeMin = floor(differenceTime / (60.0 * 1000.0))
aapsLogger.debug(LTag.PUMP, "canceling running TBR - syncTemporaryBasalWithPumpId [date=${runningTBR.date}, " + aapsLogger.debug(LTag.PUMP, "canceling running TBR - syncTemporaryBasalWithPumpId [date=${runningTBR.date}, " +
"pumpId=${runningTBR.pumpId}, rate=${runningTBR.rate} U, duration=${differenceTimeMin.toInt()}, " + "pumpId=${runningTBR.pumpId}, rate=${runningTBR.rate} U, duration=${differenceTimeMin.toInt()}, " +
@ -1160,7 +1163,7 @@ class MedtronicPumpPlugin @Inject constructor(
stringBuilder.append(profileEntry.rate) stringBuilder.append(profileEntry.rate)
} }
} }
return if (stringBuilder.length == 0) null else stringBuilder.toString() return if (stringBuilder.isEmpty()) null else stringBuilder.toString()
} }
private fun convertProfileToMedtronicProfile(profile: Profile): BasalProfile { private fun convertProfileToMedtronicProfile(profile: Profile): BasalProfile {
@ -1186,7 +1189,7 @@ class MedtronicPumpPlugin @Inject constructor(
override fun getCustomActions(): List<CustomAction>? { override fun getCustomActions(): List<CustomAction>? {
if (customActions == null) { if (customActions == null) {
customActions = Arrays.asList(customActionWakeUpAndTune, // customActions = listOf(customActionWakeUpAndTune, //
customActionClearBolusBlock, // customActionClearBolusBlock, //
customActionResetRLConfig) customActionResetRLConfig)
} }
@ -1194,8 +1197,7 @@ class MedtronicPumpPlugin @Inject constructor(
} }
override fun executeCustomAction(customActionType: CustomActionType) { override fun executeCustomAction(customActionType: CustomActionType) {
val mcat = customActionType as? MedtronicCustomActionType when (customActionType as? MedtronicCustomActionType) {
when (mcat) {
MedtronicCustomActionType.WakeUpAndTune -> { MedtronicCustomActionType.WakeUpAndTune -> {
if (rileyLinkMedtronicService.verifyConfiguration()) { if (rileyLinkMedtronicService.verifyConfiguration()) {
serviceTaskExecutor.startTask(WakeAndTuneTask(injector)) serviceTaskExecutor.startTask(WakeAndTuneTask(injector))
@ -1229,6 +1231,7 @@ class MedtronicPumpPlugin @Inject constructor(
return sp.getBoolean(R.string.key_set_neutral_temps, true) return sp.getBoolean(R.string.key_set_neutral_temps, true)
} }
@Suppress("SameParameterValue")
private fun setEnableCustomAction(customAction: MedtronicCustomActionType, isEnabled: Boolean) { private fun setEnableCustomAction(customAction: MedtronicCustomActionType, isEnabled: Boolean) {
if (customAction === MedtronicCustomActionType.ClearBolusBlock) { if (customAction === MedtronicCustomActionType.ClearBolusBlock) {
customActionClearBolusBlock.isEnabled = isEnabled customActionClearBolusBlock.isEnabled = isEnabled

View file

@ -164,7 +164,7 @@ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface {
sb.append("]") sb.append("]")
return sb.toString() return sb.toString()
} }
if (head!=null && head.size != 0) { if (head.isNotEmpty()) {
sb.append(", head=") sb.append(", head=")
sb.append(ByteUtil.shortHexString(head)) sb.append(ByteUtil.shortHexString(head))
} }

View file

@ -474,7 +474,7 @@ class MedtronicHistoryData @Inject constructor(
for (bolus in entryList) { for (bolus in entryList) {
val bolusDTO = bolus.decodedData["Object"] as BolusDTO val bolusDTO = bolus.decodedData["Object"] as BolusDTO
var type: DetailedBolusInfo.BolusType = DetailedBolusInfo.BolusType.NORMAL //var type: DetailedBolusInfo.BolusType = DetailedBolusInfo.BolusType.NORMAL
var multiwave = false var multiwave = false
if (bolusDTO.bolusType == PumpBolusType.Extended) { if (bolusDTO.bolusType == PumpBolusType.Extended) {
@ -502,7 +502,7 @@ class MedtronicHistoryData @Inject constructor(
temporaryId = entryWithTempId.temporaryId temporaryId = entryWithTempId.temporaryId
pumpSyncStorage.removeBolusWithTemporaryId(temporaryId) pumpSyncStorage.removeBolusWithTemporaryId(temporaryId)
boluses.remove(entryWithTempId) boluses.remove(entryWithTempId)
type = entryWithTempId.bolusType //type = entryWithTempId.bolusType
} }
} }
@ -584,7 +584,7 @@ class MedtronicHistoryData @Inject constructor(
} else { } else {
if (oneMoreEntryFromHistory != null) { if (oneMoreEntryFromHistory != null) {
val tbrPrev = oneMoreEntryFromHistory.getDecodedDataEntry("Object") as TempBasalPair val tbrPrev = oneMoreEntryFromHistory.getDecodedDataEntry("Object") as TempBasalPair
if (tbrPrev.isZeroTBR) { // if we had Zere TBR in last previous TBR, then we need to limit it, so we need to process it too if (tbrPrev.isZeroTBR) { // if we had Zero TBR in last previous TBR, then we need to limit it, so we need to process it too
entryList.add(0, oneMoreEntryFromHistory) entryList.add(0, oneMoreEntryFromHistory)
} }
} }
@ -592,7 +592,7 @@ class MedtronicHistoryData @Inject constructor(
val tbrRecords = pumpSyncStorage.getTBRs() val tbrRecords = pumpSyncStorage.getTBRs()
val processList: MutableList<TempBasalProcessDTO> = createTBRProcessList(entryList); val processList: MutableList<TempBasalProcessDTO> = createTBRProcessList(entryList)
if (processList.isNotEmpty()) { if (processList.isNotEmpty()) {
for (tempBasalProcessDTO in processList) { for (tempBasalProcessDTO in processList) {
@ -735,7 +735,7 @@ class MedtronicHistoryData @Inject constructor(
for (tempBasalProcessDTO in processList) { for (tempBasalProcessDTO in processList) {
if (previousItem!=null) { if (previousItem!=null) {
var pheEnd = PumpHistoryEntry() val pheEnd = PumpHistoryEntry()
pheEnd.atechDateTime = DateTimeUtil.getATDWithAddedSeconds(tempBasalProcessDTO.itemOne.atechDateTime, -2) pheEnd.atechDateTime = DateTimeUtil.getATDWithAddedSeconds(tempBasalProcessDTO.itemOne.atechDateTime, -2)
pheEnd.addDecodedData("Object", TempBasalPair(0.0, false, 0)) pheEnd.addDecodedData("Object", TempBasalPair(0.0, false, 0))

View file

@ -1,10 +1,8 @@
package info.nightscout.androidaps.plugins.pump.medtronic.data.dto package info.nightscout.androidaps.plugins.pump.medtronic.data.dto
import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil
import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry
import java.lang.StringBuilder
class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry,
var aapsLogger: AAPSLogger, var aapsLogger: AAPSLogger,
@ -66,17 +64,15 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry,
if (itemTwo!=null) { if (itemTwo!=null) {
stringBuilder.append(" - ") stringBuilder.append(" - ")
stringBuilder.append(itemTwo!!.DT) stringBuilder.append(itemTwo?.DT)
} }
var dur = durationAsSeconds
stringBuilder.append(" " + durationAsSeconds + " s (" + durationAsSeconds/60 + ")") stringBuilder.append(" " + durationAsSeconds + " s (" + durationAsSeconds/60 + ")")
if (itemTwoTbr!=null) { if (itemTwoTbr!=null) {
stringBuilder.append(" " + itemOneTbr!!.insulinRate + " / " + itemTwoTbr!!.insulinRate) stringBuilder.append(" " + itemOneTbr?.insulinRate + " / " + itemTwoTbr?.insulinRate)
} else { } else {
stringBuilder.append(" " + itemOneTbr!!.insulinRate) stringBuilder.append(" " + itemOneTbr?.insulinRate)
} }
return stringBuilder.toString() return stringBuilder.toString()
@ -86,12 +82,6 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry,
return "ItemOne: $itemOne, ItemTwo: $itemTwo, Duration: $durationAsSeconds, ObjectType: $objectType" return "ItemOne: $itemOne, ItemTwo: $itemTwo, Duration: $durationAsSeconds, ObjectType: $objectType"
} }
enum class Operation {
None,
Add,
Edit
}
enum class ObjectType { enum class ObjectType {
TemporaryBasal, TemporaryBasal,
Suspend, Suspend,

View file

@ -244,7 +244,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
get() { get() {
return time?.let { return time?.let {
return Duration.between(ZonedDateTime.now(), it) return Duration.between(ZonedDateTime.now(), it)
} ?: null }
} }
override val timeZoneUpdated: Long? override val timeZoneUpdated: Long?