Skip to content

Commit

Permalink
Merge pull request #353 from loopandlearn/update_pump_manager
Browse files Browse the repository at this point in the history
Update FreeAPS code to remove extra pod getStatus messages
  • Loading branch information
MikePlante1 authored Jul 20, 2024
2 parents 9672da2 + 2f9b4c2 commit 8303f0a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
18 changes: 0 additions & 18 deletions FreeAPS/Sources/APS/APSManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import CoreData
import Foundation
import LoopKit
import LoopKitUI
import OmniBLE
import OmniKit
import RileyLinkKit
import SwiftDate
import Swinject

Expand Down Expand Up @@ -902,26 +899,11 @@ final class BaseAPSManager: APSManager, Injectable {
bolusReporter?.addObserver(self)
}

private func updateStatus() {
debug(.apsManager, "force update status")
guard let pump = pumpManager else {
return
}

if let omnipod = pump as? OmnipodPumpManager {
omnipod.getPodStatus { _ in }
}
if let omnipodBLE = pump as? OmniBLEPumpManager {
omnipodBLE.getPodStatus { _ in }
}
}

private func clearBolusReporter() {
bolusReporter?.removeObserver(self)
bolusReporter = nil
processQueue.asyncAfter(deadline: .now() + 0.5) {
self.bolusProgress.send(nil)
self.updateStatus()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Sources/APS/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ extension BaseDeviceDataManager: PumpManagerDelegate {

if case .inProgress = status.bolusState {
bolusTrigger.send(true)
} else {
} else if status.bolusState != .canceling {
bolusTrigger.send(false)
}

Expand Down
2 changes: 1 addition & 1 deletion OmniBLE
2 changes: 1 addition & 1 deletion OmniKit

0 comments on commit 8303f0a

Please sign in to comment.