Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github "LoopKit/LoopKit" ~> 1.0.1
github "LoopKit/LoopKit" ~> 1.1.0
github "LoopKit/xDripG5" ~> 0.8.0
github "i-schuetz/SwiftCharts" ~> 0.5.0
github "mddub/dexcom-share-client-swift" ~> 0.2.0
github "mddub/G4ShareSpy" ~> 0.3.0
github "ps2/rileylink_ios" ~> 0.12.5
github "ps2/rileylink_ios" ~> 0.12.6
github "amplitude/Amplitude-iOS" ~> 3.8.5
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github "amplitude/Amplitude-iOS" "v3.8.5"
github "mddub/G4ShareSpy" "v0.3.0"
github "LoopKit/LoopKit" "v1.0.1"
github "LoopKit/LoopKit" "v1.1.0"
github "i-schuetz/SwiftCharts" "0.5"
github "mddub/dexcom-share-client-swift" "v0.2.0"
github "ps2/rileylink_ios" "v0.12.5"
github "ps2/rileylink_ios" "v0.12.6"
github "LoopKit/xDripG5" "v0.8.0"
Binary file modified Carthage/Build/iOS/Amplitude.framework/Amplitude
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Carthage/Build/iOS/CarbKit.framework/CarbKit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Carthage/Build/iOS/CarbKit.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/Crypto.framework/Crypto
Binary file not shown.
Binary file modified Carthage/Build/iOS/Crypto.framework/Info.plist
Binary file not shown.
Binary file modified Carthage/Build/iOS/G4ShareSpy.framework/G4ShareSpy
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/GlucoseKit.framework/GlucoseKit
Binary file not shown.
Binary file modified Carthage/Build/iOS/GlucoseKit.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/InsulinKit.framework/Info.plist
Binary file not shown.
Binary file modified Carthage/Build/iOS/InsulinKit.framework/InsulinKit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/LoopKit.framework/Assets.car
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/LoopKit.framework/Info.plist
Binary file not shown.
Binary file modified Carthage/Build/iOS/LoopKit.framework/LoopKit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/LoopKit.framework/TextFieldTableViewCell.nib
Binary file not shown.
Binary file modified Carthage/Build/iOS/MinimedKit.framework/Info.plist
Binary file not shown.
Binary file modified Carthage/Build/iOS/MinimedKit.framework/MinimedKit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/NightscoutUploadKit.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/RileyLinkBLEKit.framework/Info.plist
Binary file not shown.
Binary file modified Carthage/Build/iOS/RileyLinkBLEKit.framework/RileyLinkBLEKit
Binary file not shown.
Binary file modified Carthage/Build/iOS/RileyLinkKit.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/RileyLinkKit.framework/RileyLinkKit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/ShareClient.framework/ShareClient
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/SwiftCharts.framework/SwiftCharts
Binary file not shown.
Binary file modified Carthage/Build/iOS/xDripG5.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Carthage/Build/iOS/xDripG5.framework/xDripG5
Binary file not shown.
2 changes: 1 addition & 1 deletion DoseMathTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
8 changes: 6 additions & 2 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
4D3B40041D4A9E1A00BC6334 /* G4ShareSpy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D3B40021D4A9DFE00BC6334 /* G4ShareSpy.framework */; };
4D5B7A4B1D457CCA00796CA9 /* GlucoseG4.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D5B7A4A1D457CCA00796CA9 /* GlucoseG4.swift */; };
C10428971D17BAD400DD539A /* NightscoutUploadKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C10428961D17BAD400DD539A /* NightscoutUploadKit.framework */; };
C15713821DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15713811DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift */; };
C17884631D51A7A400405663 /* BatteryIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17884621D51A7A400405663 /* BatteryIndicator.swift */; };
C18C8C511D5A351900E043FB /* NightscoutDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -386,6 +387,7 @@
4D3B40021D4A9DFE00BC6334 /* G4ShareSpy.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = G4ShareSpy.framework; path = Carthage/Build/iOS/G4ShareSpy.framework; sourceTree = "<group>"; };
4D5B7A4A1D457CCA00796CA9 /* GlucoseG4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GlucoseG4.swift; path = Loop/Models/GlucoseG4.swift; sourceTree = SOURCE_ROOT; };
C10428961D17BAD400DD539A /* NightscoutUploadKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NightscoutUploadKit.framework; path = Carthage/Build/iOS/NightscoutUploadKit.framework; sourceTree = "<group>"; };
C15713811DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MealBolusNightscoutTreatment.swift; sourceTree = "<group>"; };
C17884621D51A7A400405663 /* BatteryIndicator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BatteryIndicator.swift; sourceTree = "<group>"; };
C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NightscoutDataManager.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -626,6 +628,7 @@
43E344A01B9E144300C85C07 /* Extensions */ = {
isa = PBXGroup;
children = (
C15713811DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift */,
C17884621D51A7A400405663 /* BatteryIndicator.swift */,
4331E0771C85302200FBE832 /* CGPoint.swift */,
4346D1F51C78501000ABAFE3 /* ChartPoint.swift */,
Expand Down Expand Up @@ -1044,6 +1047,7 @@
43649A631C7A347F00523D7F /* CollectionType.swift in Sources */,
437CEEBE1CD6E0CB003C8C80 /* LoopCompletionHUDView.swift in Sources */,
43F64DD91D9C92C900D24DC6 /* TitleSubtitleTableViewCell.swift in Sources */,
C15713821DAC6983005BC4D2 /* MealBolusNightscoutTreatment.swift in Sources */,
43EA28621D517E42001BC233 /* SensorDisplayable.swift in Sources */,
435400321C9F745500D5819C /* BolusSuggestionUserInfo.swift in Sources */,
43E3449F1B9D68E900C85C07 /* StatusTableViewController.swift in Sources */,
Expand Down Expand Up @@ -1226,7 +1230,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: [email protected] (XZN842LDLT)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -1278,7 +1282,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: [email protected] (XZN842LDLT)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
19 changes: 19 additions & 0 deletions Loop/Extensions/MealBolusNightscoutTreatment.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// NightscoutTreatment.swift
// Loop
//
// Created by Pete Schwamb on 10/7/16.
// Copyright © 2016 LoopKit Authors. All rights reserved.
//

import Foundation
import NightscoutUploadKit
import CarbKit
import HealthKit

extension MealBolusNightscoutTreatment {
public convenience init(carbEntry: CarbEntry) {
let carbGrams = carbEntry.quantity.doubleValue(for: HKUnit.gram())
self.init(timestamp: carbEntry.startDate, enteredBy: "loop://\(UIDevice.current.name)", id: carbEntry.externalId, carbs: lround(carbGrams), absorptionTime: carbEntry.absorptionTime)
}
}
2 changes: 1 addition & 1 deletion Loop/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
65 changes: 63 additions & 2 deletions Loop/Managers/DeviceDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ShareClient
import xDripG5


final class DeviceDataManager: CarbStoreDelegate, DoseStoreDelegate, TransmitterDelegate, ReceiverDelegate {
final class DeviceDataManager: CarbStoreDelegate, CarbStoreSyncDelegate, DoseStoreDelegate, TransmitterDelegate, ReceiverDelegate {

// MARK: - Utilities

Expand Down Expand Up @@ -306,7 +306,7 @@ final class DeviceDataManager: CarbStoreDelegate, DoseStoreDelegate, Transmitter
- Success(status, date): The pump status, and the resolved date according to the pump's clock
- Failure(error): An error describing why the command failed
*/
private func readPumpData(_ completion: @escaping (Either<(status: RileyLinkKit.PumpStatus, date: Date), Error>) -> Void) {
private func readPumpData(_ completion: @escaping (RileyLinkKit.Either<(status: RileyLinkKit.PumpStatus, date: Date), Error>) -> Void) {
guard let device = rileyLinkManager.firstConnectedDevice, let ops = device.ops else {
completion(.failure(LoopError.configurationError))
return
Expand Down Expand Up @@ -839,6 +839,66 @@ final class DeviceDataManager: CarbStoreDelegate, DoseStoreDelegate, Transmitter
logger.addError(error, fromSource: "CarbStore")
}

func carbStore(_ carbStore: CarbStore, hasEntriesNeedingUpload entries: [CarbEntry], withCompletion completionHandler: @escaping (_ uploadedObjects: [String]) -> Void) {

guard let uploader = remoteDataManager.nightscoutUploader else {
completionHandler([])
return
}

let nsCarbEntries = entries.map({ MealBolusNightscoutTreatment(carbEntry: $0)})

uploader.upload(nsCarbEntries) { (result) in
switch result {
case .success(let ids):
// Pass new ids back
completionHandler(ids)
case .failure(let error):
self.logger.addError(error, fromSource: "NightscoutUploader")
completionHandler([])
}
}
}

func carbStore(_ carbStore: CarbStore, hasModifiedEntries entries: [CarbEntry], withCompletion completionHandler: @escaping (_ uploadedObjects: [String]) -> Void) {

guard let uploader = remoteDataManager.nightscoutUploader else {
completionHandler([])
return
}

let nsCarbEntries = entries.map({ MealBolusNightscoutTreatment(carbEntry: $0)})

uploader.modifyTreatments(nsCarbEntries) { (error) in
if let error = error {
self.logger.addError(error, fromSource: "NightscoutUploader")
completionHandler([])
} else {
completionHandler(entries.map { $0.externalId ?? "" } )
}
}

}

func carbStore(_ carbStore: CarbStore, hasDeletedEntries ids: [String], withCompletion completionHandler: @escaping ([String]) -> Void) {

guard let uploader = remoteDataManager.nightscoutUploader else {
completionHandler([])
return
}

uploader.deleteTreatmentsById(ids) { (error) in
if let error = error {
self.logger.addError(error, fromSource: "NightscoutUploader")
completionHandler([])
} else {
completionHandler(ids)
}
}
completionHandler([])
}


// MARK: - GlucoseKit

let glucoseStore: GlucoseStore? = GlucoseStore()
Expand Down Expand Up @@ -939,6 +999,7 @@ final class DeviceDataManager: CarbStoreDelegate, DoseStoreDelegate, Transmitter
nightscoutDataManager = NightscoutDataManager(deviceDataManager: self)

carbStore?.delegate = self
carbStore?.syncDelegate = self
doseStore.delegate = self

if UserDefaults.standard.receiverEnabled {
Expand Down
25 changes: 22 additions & 3 deletions Loop/Managers/LoopDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ final class LoopDataManager {
center.addObserver(forName: .CarbEntriesDidUpdate, object: nil, queue: nil) { (note) -> Void in
self.dataAccessQueue.async {
self.carbEffect = nil
self.carbsOnBoardSeries = nil
self.notify(forChange: .carbs)
}
}
Expand Down Expand Up @@ -165,6 +166,18 @@ final class LoopDataManager {
}
}

if carbsOnBoardSeries == nil, let carbStore = deviceDataManager.carbStore {
updateGroup.enter()
carbStore.getCarbsOnBoardValues { (values, error) in
if let error = error {
self.deviceDataManager.logger.addError(error, fromSource: "CarbStore")
}

self.carbsOnBoardSeries = values
updateGroup.leave()
}
}

if insulinEffect == nil {
updateGroup.enter()
updateInsulinEffect { (effects, error) in
Expand Down Expand Up @@ -229,9 +242,10 @@ final class LoopDataManager {
- lastTempBasal: The last set temp basal
- lastLoopCompleted: The last date at which a loop completed, from prediction to dose (if dosing is enabled)
- insulinOnBoard Current insulin on board
- carbsOnBoard Current carbs on board
- error: An error in the current state of the loop, or one that happened during the last attempt to loop.
*/
func getLoopStatus(_ resultsHandler: @escaping (_ predictedGlucose: [GlucoseValue]?, _ retrospectivePredictedGlucose: [GlucoseValue]?, _ recommendedTempBasal: TempBasalRecommendation?, _ lastTempBasal: DoseEntry?, _ lastLoopCompleted: Date?, _ insulinOnBoard: InsulinValue?, _ error: Error?) -> Void) {
func getLoopStatus(_ resultsHandler: @escaping (_ predictedGlucose: [GlucoseValue]?, _ retrospectivePredictedGlucose: [GlucoseValue]?, _ recommendedTempBasal: TempBasalRecommendation?, _ lastTempBasal: DoseEntry?, _ lastLoopCompleted: Date?, _ insulinOnBoard: InsulinValue?, _ carbsOnBoard: CarbValue?, _ error: Error?) -> Void) {
dataAccessQueue.async {
var error: Error?

Expand All @@ -241,7 +255,9 @@ final class LoopDataManager {
error = updateError
}

resultsHandler(self.predictedGlucose, self.retrospectivePredictedGlucose, self.recommendedTempBasal, self.lastTempBasal, self.lastLoopCompleted, self.insulinOnBoard, error ?? self.lastLoopError)
let currentCOB = self.carbsOnBoardSeries?.closestPriorToDate(Date())

resultsHandler(self.predictedGlucose, self.retrospectivePredictedGlucose, self.recommendedTempBasal, self.lastTempBasal, self.lastLoopCompleted, self.insulinOnBoard, currentCOB, error ?? self.lastLoopError)
}
}

Expand Down Expand Up @@ -294,6 +310,7 @@ final class LoopDataManager {
retrospectivePredictedGlucose = nil
}
}
private var carbsOnBoardSeries: [CarbValue]?
private var insulinEffect: [GlucoseEffect]? {
didSet {
if let bolusDate = lastBolus?.date, bolusDate.timeIntervalSinceNow < TimeInterval(minutes: -5) {
Expand Down Expand Up @@ -544,6 +561,7 @@ final class LoopDataManager {
self.dataAccessQueue.async {
if success {
self.carbEffect = nil
self.carbsOnBoardSeries = nil

do {
try self.update()
Expand Down Expand Up @@ -673,7 +691,7 @@ extension LoopDataManager {
///
/// - parameter completionHandler: A closure called once the report has been generated. The closure takes a single argument of the report string.
func generateDiagnosticReport(_ completionHandler: @escaping (_ report: String) -> Void) {
getLoopStatus { (predictedGlucose, retrospectivePredictedGlucose, recommendedTempBasal, lastTempBasal, lastLoopCompleted, insulinOnBoard, error) in
getLoopStatus { (predictedGlucose, retrospectivePredictedGlucose, recommendedTempBasal, lastTempBasal, lastLoopCompleted, insulinOnBoard, carbsOnBoard, error) in
let report = [
"## LoopDataManager",
"predictedGlucose: \(predictedGlucose ?? [])",
Expand All @@ -682,6 +700,7 @@ extension LoopDataManager {
"lastTempBasal: \(lastTempBasal)",
"lastLoopCompleted: \(lastLoopCompleted ?? .distantPast)",
"insulinOnBoard: \(insulinOnBoard)",
"carbsOnBoard: \(carbsOnBoard)",
"error: \(error)"
]
completionHandler(report.joined(separator: "\n"))
Expand Down
17 changes: 13 additions & 4 deletions Loop/Managers/NightscoutDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import NightscoutUploadKit
import CarbKit
import HealthKit
import InsulinKit
import LoopKit
Expand All @@ -34,20 +35,20 @@ class NightscoutDataManager {
return
}

deviceDataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, _, insulinOnBoard, loopError) in
deviceDataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, _, insulinOnBoard, carbsOnBoard, loopError) in

self.deviceDataManager.loopManager.getRecommendedBolus { (bolusUnits, getBolusError) in
if let getBolusError = getBolusError {
self.deviceDataManager.logger.addError(getBolusError, fromSource: "NightscoutDataManager")
}
self.uploadLoopStatus(insulinOnBoard, predictedGlucose: predictedGlucose, recommendedTempBasal: recommendedTempBasal, recommendedBolus: bolusUnits, lastTempBasal: lastTempBasal, loopError: loopError ?? getBolusError)
self.uploadLoopStatus(insulinOnBoard, carbsOnBoard: carbsOnBoard, predictedGlucose: predictedGlucose, recommendedTempBasal: recommendedTempBasal, recommendedBolus: bolusUnits, lastTempBasal: lastTempBasal, loopError: loopError ?? getBolusError)
}
}
}

private var lastTempBasalUploaded: DoseEntry?

func uploadLoopStatus(_ insulinOnBoard: InsulinValue? = nil, predictedGlucose: [GlucoseValue]? = nil, recommendedTempBasal: LoopDataManager.TempBasalRecommendation? = nil, recommendedBolus: Double? = nil, lastTempBasal: DoseEntry? = nil, loopError: Error? = nil) {
func uploadLoopStatus(_ insulinOnBoard: InsulinValue? = nil, carbsOnBoard: CarbValue? = nil, predictedGlucose: [GlucoseValue]? = nil, recommendedTempBasal: LoopDataManager.TempBasalRecommendation? = nil, recommendedBolus: Double? = nil, lastTempBasal: DoseEntry? = nil, loopError: Error? = nil) {

guard deviceDataManager.remoteDataManager.nightscoutUploader != nil else {
return
Expand All @@ -62,6 +63,14 @@ class NightscoutDataManager {
} else {
iob = nil
}

let cob: COBStatus?

if let carbsOnBoard = carbsOnBoard {
cob = COBStatus(cob: carbsOnBoard.quantity.doubleValue(for: HKUnit.gram()), timestamp: carbsOnBoard.startDate)
} else {
cob = nil
}

let predicted: PredictedBG?
if let predictedGlucose = predictedGlucose, let startDate = predictedGlucose.first?.startDate {
Expand Down Expand Up @@ -93,7 +102,7 @@ class NightscoutDataManager {
let loopName = Bundle.main.bundleDisplayName
let loopVersion = Bundle.main.shortVersionString

let loopStatus = LoopStatus(name: loopName, version: loopVersion, timestamp: statusTime, iob: iob, predicted: predicted, recommendedTempBasal: recommended, recommendedBolus: recommendedBolus, enacted: loopEnacted, failureReason: loopError)
let loopStatus = LoopStatus(name: loopName, version: loopVersion, timestamp: statusTime, iob: iob, cob: cob, predicted: predicted, recommendedTempBasal: recommended, recommendedBolus: recommendedBolus, enacted: loopEnacted, failureReason: loopError)

uploadDeviceStatus(nil, loopStatus: loopStatus, includeUploaderStatus: false)

Expand Down
2 changes: 1 addition & 1 deletion Loop/Managers/WatchDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ final class WatchDataManager: NSObject, WCSessionDelegate {
let reservoir = deviceDataManager.doseStore.lastReservoirValue
let maxBolus = deviceDataManager.maximumBolus

deviceDataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, lastLoopCompleted, _, error) in
deviceDataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, lastLoopCompleted, _, _, error) in
let eventualGlucose = predictedGlucose?.last

self.deviceDataManager.loopManager.getRecommendedBolus { (units, error) in
Expand Down
2 changes: 1 addition & 1 deletion Loop/View Controllers/PredictionTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class PredictionTableViewController: UITableViewController, IdentifiableClass, U
}

reloadGroup.enter()
self.dataManager.loopManager.getLoopStatus { (predictedGlucose, retrospectivePredictedGlucose, _, _, _, _, error) in
self.dataManager.loopManager.getLoopStatus { (predictedGlucose, retrospectivePredictedGlucose, _, _, _, _, _, error) in
if error != nil {
self.needsRefresh = true
}
Expand Down
2 changes: 1 addition & 1 deletion Loop/View Controllers/StatusTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ final class StatusTableViewController: UITableViewController, UIGestureRecognize
}

reloadGroup.enter()
self.dataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, lastLoopCompleted, _, error) -> Void in
self.dataManager.loopManager.getLoopStatus { (predictedGlucose, _, recommendedTempBasal, lastTempBasal, lastLoopCompleted, _, _, error) -> Void in
if error != nil {
self.needsRefresh = true
}
Expand Down
Loading