Fix ExtendedBolus and EmulatingTempBasal
This commit is contained in:
parent
17d7464239
commit
f22c8ca642
1 changed files with 5 additions and 11 deletions
|
@ -138,23 +138,17 @@ open class AutotuneIob @Inject constructor(
|
|||
//nsTreatment is used only for export data
|
||||
private fun initializeExtendedBolusData(from: Long, to: Long, tunedProfile: ATProfile) {
|
||||
val extendedBoluses = repository.getExtendedBolusDataFromTimeToTime(from, to, false).blockingGet()
|
||||
val pumpInterface = activePlugin.activePump
|
||||
if (pumpInterface.isFakingTempsByExtendedBoluses) {
|
||||
for (i in extendedBoluses.indices) {
|
||||
val eb = extendedBoluses[i]
|
||||
if (eb.isValid)
|
||||
for (i in extendedBoluses.indices) {
|
||||
val eb = extendedBoluses[i]
|
||||
if (eb.isValid)
|
||||
if (eb.isEmulatingTempBasal) {
|
||||
profileFunction.getProfile(eb.timestamp)?.let {
|
||||
toSplittedTimestampTB(eb.toTemporaryBasal(it), tunedProfile)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i in extendedBoluses.indices) {
|
||||
val eb = extendedBoluses[i]
|
||||
if (eb.isValid) {
|
||||
} else {
|
||||
nsTreatments.add(NsTreatment(eb))
|
||||
boluses.addAll(convertToBoluses(eb))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue