Prevent Failed requirement
This commit is contained in:
parent
51a42e5784
commit
3a30f73aa1
2 changed files with 2 additions and 3 deletions
|
@ -3,12 +3,10 @@ package info.nightscout.androidaps.dependencyInjection
|
||||||
import dagger.Module
|
import dagger.Module
|
||||||
import dagger.android.ContributesAndroidInjector
|
import dagger.android.ContributesAndroidInjector
|
||||||
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback
|
||||||
import info.nightscout.androidaps.plugins.aps.loop.APSResult
|
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.DetermineBasalAdapterAMAJS
|
import info.nightscout.androidaps.plugins.aps.openAPSAMA.DetermineBasalAdapterAMAJS
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.DetermineBasalResultAMA
|
import info.nightscout.androidaps.plugins.aps.openAPSAMA.DetermineBasalResultAMA
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS
|
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS
|
||||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB
|
import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData
|
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Thread
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Thread
|
||||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobThread
|
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobThread
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ class SyncPumpCancelTemporaryBasalIfAnyTransaction(
|
||||||
return result
|
return result
|
||||||
val current = database.temporaryBasalDao.getTemporaryBasalActiveAt(timestamp, pumpType, pumpSerial).blockingGet()
|
val current = database.temporaryBasalDao.getTemporaryBasalActiveAt(timestamp, pumpType, pumpSerial).blockingGet()
|
||||||
if (current != null && current.interfaceIDs.endId == null) { // do not allow overwrite if cut by end event
|
if (current != null && current.interfaceIDs.endId == null) { // do not allow overwrite if cut by end event
|
||||||
current.end = timestamp
|
if (current.timestamp != timestamp) current.end = timestamp // prevent zero duration
|
||||||
|
else current.duration = 1
|
||||||
current.interfaceIDs.endId = endPumpId
|
current.interfaceIDs.endId = endPumpId
|
||||||
database.temporaryBasalDao.updateExistingEntry(current)
|
database.temporaryBasalDao.updateExistingEntry(current)
|
||||||
result.updated.add(current)
|
result.updated.add(current)
|
||||||
|
|
Loading…
Reference in a new issue