diff --git a/Cartfile b/Cartfile index ffaa9c09ce..4f8e32a7af 100644 --- a/Cartfile +++ b/Cartfile @@ -1,7 +1,7 @@ -github "LoopKit/LoopKit" == 1.5.5 -github "LoopKit/CGMBLEKit" ~> 2.0 +github "LoopKit/LoopKit" == 1.5.6 +github "LoopKit/CGMBLEKit" == 2.1 github "i-schuetz/SwiftCharts" == 0.6.1 github "mddub/dexcom-share-client-swift" == 0.4.1 github "mddub/G4ShareSpy" == 0.3.3 github "ps2/rileylink_ios" == 2.0.0 -github "amplitude/Amplitude-iOS" ~> 3.8.5 +github "LoopKit/Amplitude-iOS" "decreepify" diff --git a/Cartfile.resolved b/Cartfile.resolved index d2ac7370e5..5b46c41bb2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,6 +1,6 @@ -github "LoopKit/CGMBLEKit" "v2.0" -github "LoopKit/LoopKit" "v1.5.5" -github "amplitude/Amplitude-iOS" "v3.14.1" +github "LoopKit/Amplitude-iOS" "2137d5fd44bf630ed33e1e72d7af6d8f8612f270" +github "LoopKit/CGMBLEKit" "v2.1.0" +github "LoopKit/LoopKit" "v1.5.6" github "i-schuetz/SwiftCharts" "6b55a26a7b0b95e49202ddc1db5404702fce114f" github "mddub/G4ShareSpy" "v0.3.3" github "mddub/dexcom-share-client-swift" "v0.4.1" diff --git a/Carthage/Build/.Amplitude-iOS.version b/Carthage/Build/.Amplitude-iOS.version index 8ebbee94f7..6c790cc4b2 100644 --- a/Carthage/Build/.Amplitude-iOS.version +++ b/Carthage/Build/.Amplitude-iOS.version @@ -8,11 +8,11 @@ "tvOS" : [ ], - "commitish" : "v3.14.1", + "commitish" : "2137d5fd44bf630ed33e1e72d7af6d8f8612f270", "iOS" : [ { "name" : "Amplitude", - "hash" : "6d22c00833bfcaa5d34ba1331c1144a93e8999bad97ade70be089aba729a9fbe" + "hash" : "5f7cea951cf973d78073e75b87cd222891b181a3879b081a42f057d983b7c389" } ] } \ No newline at end of file diff --git a/Carthage/Build/.CGMBLEKit.version b/Carthage/Build/.CGMBLEKit.version index 1e31df3f4e..0e5d1875f6 100644 --- a/Carthage/Build/.CGMBLEKit.version +++ b/Carthage/Build/.CGMBLEKit.version @@ -5,17 +5,17 @@ "watchOS" : [ { "name" : "CGMBLEKit", - "hash" : "575d04bdf7c1104cf77670c7a4298307717595e99a187c613f6059a285e1b994" + "hash" : "ade5de40f0722c07387d73c66678eefb12db2e028e0eb3ced4810ab415469e16" } ], "tvOS" : [ ], - "commitish" : "v2.0", + "commitish" : "v2.1.0", "iOS" : [ { "name" : "CGMBLEKit", - "hash" : "406ed00637ad11854d93d89f6ad171b00e7a48a652475e3fa9bdcb4bc2f1698d" + "hash" : "48dd66b1f45d9e92de8553d4e9f24cb9fb1ff2b1fdf7be0d2b8fda10d1ec8ea7" } ] } \ No newline at end of file diff --git a/Carthage/Build/.LoopKit.version b/Carthage/Build/.LoopKit.version index 1a53b51eee..6777a46027 100644 --- a/Carthage/Build/.LoopKit.version +++ b/Carthage/Build/.LoopKit.version @@ -8,23 +8,23 @@ "tvOS" : [ ], - "commitish" : "v1.5.5", + "commitish" : "v1.5.6", "iOS" : [ { "name" : "GlucoseKit", - "hash" : "5dee38f5899972ffefc1bc5e1d45a7f569bd903f321f92ceff52c1426f27c9ac" + "hash" : "1ef4ccb9582a5a31643443c4e5c8d0fef7ef760c30cd09f545508e6a8458ae92" }, { - "name" : "CarbKit", - "hash" : "95604f653082fd6f5d2353c368d22e5d55505e3728df7d65fd124ab40d8cf908" + "name" : "InsulinKit", + "hash" : "15de73844cdbc5e2e1277ab01ac5d39c8085f5aeb6718aab4a8257c1943c902e" }, { "name" : "LoopKit", - "hash" : "4bc51d30fcb5a4572948d3e555214eccf71fea63404e6f64cb011d5767d5242e" + "hash" : "4fc0c5f661d96f375b30647728c1a2ff2164cd41ce046bbb86f8dc86bf9b76a8" }, { - "name" : "InsulinKit", - "hash" : "c77e75c0e772386fc50e389cde14111b72978b54263690a5b7aea237b067c5a5" + "name" : "CarbKit", + "hash" : "aed7066da389d043482db40034f6d63b220b15852d0f6fe7ef9739ee8835b87f" } ] } \ No newline at end of file diff --git a/Carthage/Build/iOS/Amplitude.framework/Amplitude b/Carthage/Build/iOS/Amplitude.framework/Amplitude index c78691bf75..a761b896f9 100755 Binary files a/Carthage/Build/iOS/Amplitude.framework/Amplitude and b/Carthage/Build/iOS/Amplitude.framework/Amplitude differ diff --git a/Carthage/Build/iOS/Amplitude.framework/Headers/AMPDeviceInfo.h b/Carthage/Build/iOS/Amplitude.framework/Headers/AMPDeviceInfo.h index 1e18cd5f93..945c2e5e7e 100644 --- a/Carthage/Build/iOS/Amplitude.framework/Headers/AMPDeviceInfo.h +++ b/Carthage/Build/iOS/Amplitude.framework/Headers/AMPDeviceInfo.h @@ -3,7 +3,7 @@ @interface AMPDeviceInfo : NSObject --(id) init; +-(id) init: (BOOL) disableIdfaTracking; @property (readonly) NSString *appVersion; @property (readonly) NSString *osName; @property (readonly) NSString *osVersion; diff --git a/Carthage/Build/iOS/Amplitude.framework/Headers/Amplitude.h b/Carthage/Build/iOS/Amplitude.framework/Headers/Amplitude.h index 729509d045..8dc562b218 100644 --- a/Carthage/Build/iOS/Amplitude.framework/Headers/Amplitude.h +++ b/Carthage/Build/iOS/Amplitude.framework/Headers/Amplitude.h @@ -445,6 +445,15 @@ */ - (void)setUserId:(NSString*) userId; +/** + Sets the userId and starts a new session. The previous session for the previous user will be terminated and a new session will begin for the new user id. + + @param userId If your app has its own login system that you want to track users with, you can set the userId. + + @see [Setting Custom UserIds](https://github.com/amplitude/Amplitude-iOS#setting-custom-user-ids) + */ +- (void)setUserId:(NSString*) userId startNewSession:(BOOL) startNewSession; + /** Sets the deviceId. @@ -509,6 +518,13 @@ */ - (void)useAdvertisingIdForDeviceId; +/** + Disables tracking of advertisingIdentifier by the SDK + + **NOTE:** Must be called before initializeApiKey: is called to function. + */ +- (void)disableIdfaTracking; + /**----------------------------------------------------------------------------- * @name Other Methods * ----------------------------------------------------------------------------- diff --git a/Carthage/Build/iOS/Amplitude.framework/Info.plist b/Carthage/Build/iOS/Amplitude.framework/Info.plist index 23b1605dc0..a963fa3eb3 100644 Binary files a/Carthage/Build/iOS/Amplitude.framework/Info.plist and b/Carthage/Build/iOS/Amplitude.framework/Info.plist differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit b/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit index 9519695f4e..a158773f4f 100755 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit and b/Carthage/Build/iOS/CGMBLEKit.framework/CGMBLEKit differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h b/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h index 1d603aadfd..7c90b3f2f3 100644 --- a/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h +++ b/Carthage/Build/iOS/CGMBLEKit.framework/Headers/CGMBLEKit-Swift.h @@ -1,4 +1,4 @@ -// Generated by Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1) +// Generated by Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgcc-compat" @@ -163,6 +163,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if __has_feature(modules) +@import ObjectiveC; @import CoreBluetooth; @import HealthKit; #endif @@ -183,6 +184,63 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif +SWIFT_CLASS("_TtC9CGMBLEKit16BluetoothManager") +@interface BluetoothManager : NSObject +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + + + +@class CBCentralManager; +@class CBPeripheral; +@class NSNumber; + +@interface BluetoothManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)centralManagerDidUpdateState:(CBCentralManager * _Nonnull)central; +- (void)centralManager:(CBCentralManager * _Nonnull)central willRestoreState:(NSDictionary * _Nonnull)dict; +- (void)centralManager:(CBCentralManager * _Nonnull)central didDiscoverPeripheral:(CBPeripheral * _Nonnull)peripheral advertisementData:(NSDictionary * _Nonnull)advertisementData RSSI:(NSNumber * _Nonnull)RSSI; +- (void)centralManager:(CBCentralManager * _Nonnull)central didConnectPeripheral:(CBPeripheral * _Nonnull)peripheral; +- (void)centralManager:(CBCentralManager * _Nonnull)central didDisconnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error; +- (void)centralManager:(CBCentralManager * _Nonnull)central didFailToConnectPeripheral:(CBPeripheral * _Nonnull)peripheral error:(NSError * _Nullable)error; +@end + + + + + + + + +SWIFT_CLASS("_TtC9CGMBLEKit17PeripheralManager") +@interface PeripheralManager : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable"); +@end + + + + +@interface PeripheralManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)centralManagerDidUpdateState:(CBCentralManager * _Nonnull)central; +- (void)centralManager:(CBCentralManager * _Nonnull)central didConnectPeripheral:(CBPeripheral * _Nonnull)peripheral; +@end + + + + + +@class CBService; +@class CBCharacteristic; + +@interface PeripheralManager (SWIFT_EXTENSION(CGMBLEKit)) +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverServices:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didDiscoverCharacteristicsForService:(CBService * _Nonnull)service error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didWriteValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didUpdateValueForCharacteristic:(CBCharacteristic * _Nonnull)characteristic error:(NSError * _Nullable)error; +- (void)peripheral:(CBPeripheral * _Nonnull)peripheral didReadRSSI:(NSNumber * _Nonnull)RSSI error:(NSError * _Nullable)error; +- (void)peripheralDidUpdateName:(CBPeripheral * _Nonnull)peripheral; +@end diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist b/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist index 3dba5d77bb..4b5b588798 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist and b/Carthage/Build/iOS/CGMBLEKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc index 79d030817a..fc491aea5b 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule index 6428b30f47..d3a314d97a 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc index 3da9a2567d..51a1f8d3cc 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule index 9708db49d7..458a8c6327 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc index b33ef2b6a7..4c5006c673 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule index 80d2e01314..f77faf3bac 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc index 2e9075905d..06262088bb 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftdoc differ diff --git a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule index 9e5bf26a39..8da9a201f2 100644 Binary files a/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/CGMBLEKit.framework/Modules/CGMBLEKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Assets.car b/Carthage/Build/iOS/CarbKit.framework/Assets.car index b17646a739..9a30a8fa07 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Assets.car and b/Carthage/Build/iOS/CarbKit.framework/Assets.car differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit b/Carthage/Build/iOS/CarbKit.framework/CarbKit index ee75d0741d..fec280e936 100755 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit and b/Carthage/Build/iOS/CarbKit.framework/CarbKit differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/objects-11.0+.nib index f80a62e453..0486bfe4ee 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/runtime.nib index 0c2c7d2ff2..cfa3f7f0e0 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbAbsorptionInputController.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/objects-11.0+.nib index 9deba38ef7..377d06b04d 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/runtime.nib index 62247aa8a6..fa4f7c7d8e 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryEditViewController.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/objects-11.0+.nib index 5fa8d7081b..c5732723bd 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/runtime.nib index 8b3c9de308..2fa8dbae67 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/CarbEntryTableViewController.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/objects-11.0+.nib index 4d22452758..1ca760e93e 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/runtime.nib index 36ed7e85de..e45e7b27f3 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/LyL-9U-twn-view-9Ci-XW-6nA.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/objects-11.0+.nib index 3839c9772e..c3f36895b5 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/runtime.nib index d02ce35167..8611f33726 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/QAc-uE-L5K-view-ZAF-8o-e2g.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/objects-11.0+.nib index 56c71fb4c4..bb0d54205d 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/runtime.nib index 8b20734e21..4e6d64c350 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/UINavigationController-wgu-gT-TgV.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/objects-11.0+.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/objects-11.0+.nib index 7bdbd52956..c43b9bdc4f 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/objects-11.0+.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/objects-11.0+.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/runtime.nib b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/runtime.nib index 74324c3c45..9952806b2b 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/runtime.nib and b/Carthage/Build/iOS/CarbKit.framework/CarbKit.storyboardc/rUL-yg-cFX-view-b1s-8o-0Wp.nib/runtime.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/DatePickerTableViewCell.nib b/Carthage/Build/iOS/CarbKit.framework/DatePickerTableViewCell.nib index 943e9a8145..02002de103 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/DatePickerTableViewCell.nib and b/Carthage/Build/iOS/CarbKit.framework/DatePickerTableViewCell.nib differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Info.plist b/Carthage/Build/iOS/CarbKit.framework/Info.plist index 69297b53a1..081e65c882 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Info.plist and b/Carthage/Build/iOS/CarbKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm.swiftmodule index 88348cb44e..cb9e02b1b2 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm64.swiftmodule index 2d5ff4f7bd..3bae421e9a 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/i386.swiftmodule index 0f1914a473..3bb540a1c9 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/x86_64.swiftmodule index ffdcbbc761..5460cbc3e1 100644 Binary files a/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/CarbKit.framework/Modules/CarbKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/GlucoseKit b/Carthage/Build/iOS/GlucoseKit.framework/GlucoseKit index 81f7ab0846..89ee4e02d4 100755 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/GlucoseKit and b/Carthage/Build/iOS/GlucoseKit.framework/GlucoseKit differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/Info.plist b/Carthage/Build/iOS/GlucoseKit.framework/Info.plist index e9c0f8bf45..816d699ec2 100644 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/Info.plist and b/Carthage/Build/iOS/GlucoseKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm.swiftmodule index 0f122494f0..d45c871351 100644 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm64.swiftmodule index cb4b4b9d85..5bfc73a677 100644 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/i386.swiftmodule index e13cce12de..67356f2a5c 100644 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/x86_64.swiftmodule index 1fabc078dc..fd10dc28a6 100644 Binary files a/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/GlucoseKit.framework/Modules/GlucoseKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/UITableViewController-jGX-GA-nlH.nib b/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/UITableViewController-jGX-GA-nlH.nib index 49e3f94c38..f5ac10e31e 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/UITableViewController-jGX-GA-nlH.nib and b/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/UITableViewController-jGX-GA-nlH.nib differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/jGX-GA-nlH-view-ccM-3y-LQM.nib b/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/jGX-GA-nlH-view-ccM-3y-LQM.nib index 230228aa02..73ab9d38c7 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/jGX-GA-nlH-view-ccM-3y-LQM.nib and b/Carthage/Build/iOS/InsulinKit.framework/Base.lproj/InsulinKit.storyboardc/jGX-GA-nlH-view-ccM-3y-LQM.nib differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Info.plist b/Carthage/Build/iOS/InsulinKit.framework/Info.plist index c1f5686ff6..8994736d76 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Info.plist and b/Carthage/Build/iOS/InsulinKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/InsulinKit b/Carthage/Build/iOS/InsulinKit.framework/InsulinKit index 663286ab56..50b0bc1304 100755 Binary files a/Carthage/Build/iOS/InsulinKit.framework/InsulinKit and b/Carthage/Build/iOS/InsulinKit.framework/InsulinKit differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm.swiftmodule index 33cd1eb678..8c5f8d49d6 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm64.swiftmodule index 47998f7964..9d01099fe5 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/i386.swiftmodule index 938f583e8a..eaafed5888 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/x86_64.swiftmodule index 76ebec91bf..7de63982a3 100644 Binary files a/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/InsulinKit.framework/Modules/InsulinKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Assets.car b/Carthage/Build/iOS/LoopKit.framework/Assets.car index a186bf9c91..19ab224fb1 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Assets.car and b/Carthage/Build/iOS/LoopKit.framework/Assets.car differ diff --git a/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeOverrideTableViewCell.nib b/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeOverrideTableViewCell.nib index a4fa1e9678..e2ca39c33b 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeOverrideTableViewCell.nib and b/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeOverrideTableViewCell.nib differ diff --git a/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeTableViewCell.nib b/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeTableViewCell.nib index 6a7121d01e..fdbef1acfb 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeTableViewCell.nib and b/Carthage/Build/iOS/LoopKit.framework/GlucoseRangeTableViewCell.nib differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Info.plist b/Carthage/Build/iOS/LoopKit.framework/Info.plist index e6a59817c0..3e0a932f94 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Info.plist and b/Carthage/Build/iOS/LoopKit.framework/Info.plist differ diff --git a/Carthage/Build/iOS/LoopKit.framework/LoopKit b/Carthage/Build/iOS/LoopKit.framework/LoopKit index 15372e4c7d..220f81f8e0 100755 Binary files a/Carthage/Build/iOS/LoopKit.framework/LoopKit and b/Carthage/Build/iOS/LoopKit.framework/LoopKit differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm.swiftmodule b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm.swiftmodule index dc547a7665..c96ec396fe 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm.swiftmodule and b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm.swiftmodule differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm64.swiftmodule b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm64.swiftmodule index 0e5caa551a..db3dca3c5c 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm64.swiftmodule and b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/arm64.swiftmodule differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/i386.swiftmodule b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/i386.swiftmodule index b6e9688850..83fd0068ae 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/i386.swiftmodule and b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/i386.swiftmodule differ diff --git a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/x86_64.swiftmodule b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/x86_64.swiftmodule index 9cf7848b48..db50dbbd0b 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/x86_64.swiftmodule and b/Carthage/Build/iOS/LoopKit.framework/Modules/LoopKit.swiftmodule/x86_64.swiftmodule differ diff --git a/Carthage/Build/iOS/LoopKit.framework/RepeatingScheduleValueTableViewCell.nib b/Carthage/Build/iOS/LoopKit.framework/RepeatingScheduleValueTableViewCell.nib index 6d2aa6eb0f..20fa2a7277 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/RepeatingScheduleValueTableViewCell.nib and b/Carthage/Build/iOS/LoopKit.framework/RepeatingScheduleValueTableViewCell.nib differ diff --git a/Carthage/Build/iOS/LoopKit.framework/TextFieldTableViewCell.nib b/Carthage/Build/iOS/LoopKit.framework/TextFieldTableViewCell.nib index 06499afbf0..18cfa641fa 100644 Binary files a/Carthage/Build/iOS/LoopKit.framework/TextFieldTableViewCell.nib and b/Carthage/Build/iOS/LoopKit.framework/TextFieldTableViewCell.nib differ diff --git a/Common/Extensions/NSTimeInterval.swift b/Common/Extensions/NSTimeInterval.swift index d40ded0035..be19ded20d 100644 --- a/Common/Extensions/NSTimeInterval.swift +++ b/Common/Extensions/NSTimeInterval.swift @@ -10,6 +10,10 @@ import Foundation extension TimeInterval { + static func seconds(_ seconds: Double) -> TimeInterval { + return seconds + } + static func minutes(_ minutes: Double) -> TimeInterval { return TimeInterval(minutes: minutes) } diff --git a/Common/Models/WatchContext.swift b/Common/Models/WatchContext.swift index 1a3bb4da5e..f28140d222 100644 --- a/Common/Models/WatchContext.swift +++ b/Common/Models/WatchContext.swift @@ -56,14 +56,14 @@ final class WatchContext: NSObject, RawRepresentable { if let unitString = rawValue["gu"] as? String { let unit = HKUnit(from: unitString) preferredGlucoseUnit = unit + } - if let glucoseValue = rawValue["gv"] as? Double { - glucose = HKQuantity(unit: unit, doubleValue: glucoseValue) - } + if let glucoseValue = rawValue["gv"] as? Double { + glucose = HKQuantity(unit: preferredGlucoseUnit ?? .milligramsPerDeciliter(), doubleValue: glucoseValue) + } - if let glucoseValue = rawValue["egv"] as? Double { - eventualGlucose = HKQuantity(unit: unit, doubleValue: glucoseValue) - } + if let glucoseValue = rawValue["egv"] as? Double { + eventualGlucose = HKQuantity(unit: preferredGlucoseUnit ?? .milligramsPerDeciliter(), doubleValue: glucoseValue) } glucoseTrendRawValue = rawValue["gt"] as? Int @@ -102,11 +102,10 @@ final class WatchContext: NSObject, RawRepresentable { raw["bp"] = batteryPercentage raw["cob"] = COB - if let unit = preferredGlucoseUnit { - raw["egv"] = eventualGlucose?.doubleValue(for: unit) - raw["gu"] = unit.unitString - raw["gv"] = glucose?.doubleValue(for: unit) - } + let unit = preferredGlucoseUnit ?? .milligramsPerDeciliter() + raw["egv"] = eventualGlucose?.doubleValue(for: unit) + raw["gu"] = preferredGlucoseUnit?.unitString + raw["gv"] = glucose?.doubleValue(for: unit) raw["gt"] = glucoseTrendRawValue raw["gd"] = glucoseDate diff --git a/DoseMathTests/Info.plist b/DoseMathTests/Info.plist index 5bd34daaf6..6d86f6a299 100644 --- a/DoseMathTests/Info.plist +++ b/DoseMathTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleSignature ???? CFBundleVersion diff --git a/Loop Status Extension/Info.plist b/Loop Status Extension/Info.plist index dc0776ea87..9f091d68bf 100644 --- a/Loop Status Extension/Info.plist +++ b/Loop Status Extension/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleVersion $(CURRENT_PROJECT_VERSION) AppGroupIdentifier diff --git a/Loop.xcodeproj/project.pbxproj b/Loop.xcodeproj/project.pbxproj index f2db8960cc..573e187130 100644 --- a/Loop.xcodeproj/project.pbxproj +++ b/Loop.xcodeproj/project.pbxproj @@ -2055,7 +2055,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer: loudnate@gmail.com (XZN842LDLT)"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 48; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -2122,7 +2122,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer: loudnate@gmail.com (XZN842LDLT)"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 48; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -2364,11 +2364,11 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 48; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 46; + DYLIB_CURRENT_VERSION = 48; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = LoopUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -2391,11 +2391,11 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 48; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 46; + DYLIB_CURRENT_VERSION = 48; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = LoopUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; diff --git a/Loop/Extensions/DoseStore.swift b/Loop/Extensions/DoseStore.swift index 825b89ceb7..d5b0fd09bc 100644 --- a/Loop/Extensions/DoseStore.swift +++ b/Loop/Extensions/DoseStore.swift @@ -18,7 +18,8 @@ extension LoopDataManager { func addPumpEvents(_ pumpEvents: [TimestampedHistoryEvent], from model: MinimedKit.PumpModel, completion: @escaping (_ error: DoseStore.DoseStoreError?) -> Void) { var events: [NewPumpEvent] = [] var lastTempBasalAmount: DoseEntry? - var isRewound = false + // Always assume the sequence may have started rewound. LoopKit will ignore unmatched resume events. + var isRewound = true var title: String for event in pumpEvents { diff --git a/Loop/Info.plist b/Loop/Info.plist index da472e2b0c..e318f38873 100644 --- a/Loop/Info.plist +++ b/Loop/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleSignature ???? CFBundleURLTypes @@ -37,6 +37,7 @@ LSApplicationQueriesSchemes + dexcomg6 dexcomcgm dexcomshare @@ -51,7 +52,7 @@ Glucose data from the Health database is used for graphing and momentum calculat Carbohydrate meal data entered in the app and on the watch is stored in the Health database. Glucose data retrieved from the CGM is stored securely in HealthKit. NSFaceIDUsageDescription - Face ID is used to authenticate insulin boluses. + Face ID is used to authenticate insulin bolus. UIBackgroundModes bluetooth-central diff --git a/Loop/Managers/AnalyticsManager.swift b/Loop/Managers/AnalyticsManager.swift index 999bf15b5c..fe08839154 100644 --- a/Loop/Managers/AnalyticsManager.swift +++ b/Loop/Managers/AnalyticsManager.swift @@ -62,19 +62,27 @@ final class AnalyticsManager: IdentifiableClass { // MARK: - Config Events func didChangeRileyLinkConnectionState() { - logEvent("RileyLink Connection") + logEvent("RileyLink Connection", outOfSession: true) } func transmitterTimeDidDrift(_ drift: TimeInterval) { - logEvent("Transmitter time change", withProperties: ["value" : drift]) + logEvent("Transmitter time change", withProperties: ["value" : drift], outOfSession: true) + } + + func pumpTimeDidDrift(_ drift: TimeInterval) { + logEvent("Pump time change", withProperties: ["value": drift], outOfSession: true) + } + + func punpTimeZoneDidChange() { + logEvent("Pump time zone change", outOfSession: true) } func pumpBatteryWasReplaced() { - logEvent("Pump battery replacement") + logEvent("Pump battery replacement", outOfSession: true) } func reservoirWasRewound() { - logEvent("Pump reservoir rewind") + logEvent("Pump reservoir rewind", outOfSession: true) } func didChangeBasalRateSchedule() { @@ -98,7 +106,7 @@ final class AnalyticsManager: IdentifiableClass { } func didChangeLoopSettings(from oldValue: LoopSettings, to newValue: LoopSettings) { - logEvent("Loop settings change") + logEvent("Loop settings change", outOfSession: true) if newValue.maximumBasalRatePerHour != oldValue.maximumBasalRatePerHour { logEvent("Maximum basal rate change") @@ -111,6 +119,14 @@ final class AnalyticsManager: IdentifiableClass { if newValue.suspendThreshold != oldValue.suspendThreshold { logEvent("Minimum BG Guard change") } + + if newValue.dosingEnabled != oldValue.dosingEnabled { + logEvent("Closed loop enabled change") + } + + if newValue.retrospectiveCorrectionEnabled != oldValue.retrospectiveCorrectionEnabled { + logEvent("Retrospective correction enabled change") + } } // MARK: - Loop Events @@ -127,6 +143,10 @@ final class AnalyticsManager: IdentifiableClass { logEvent("Bolus set", withProperties: ["source" : "Watch"], outOfSession: true) } + func didFetchNewCGMData() { + logEvent("CGM Fetch", outOfSession: true) + } + func loopDidSucceed() { logEvent("Loop success", outOfSession: true) } diff --git a/Loop/Managers/CGM/DexCGMManager.swift b/Loop/Managers/CGM/DexCGMManager.swift index a6dfa6ba36..30fd0fbaa3 100644 --- a/Loop/Managers/CGM/DexCGMManager.swift +++ b/Loop/Managers/CGM/DexCGMManager.swift @@ -93,7 +93,7 @@ final class ShareClientManager: CGMManager { // Ignore glucose values that are up to a minute newer than our previous value, to account for possible time shifting in Share data let startDate = self.delegate?.startDateToFilterNewData(for: self)?.addingTimeInterval(TimeInterval(minutes: 1)) - let newGlucose = glucose.filterDateRange(startDate, nil).map { + let newGlucose = glucose.filterDateRange(startDate, nil).filter({ $0.isStateValid }).map { return (quantity: $0.quantity, date: $0.startDate, isDisplayOnly: false) } @@ -183,7 +183,7 @@ final class G5CGMManager: DexCGMManager, TransmitterDelegate { return HKDevice( name: "CGMBLEKit", manufacturer: "Dexcom", - model: "G5 Mobile", + model: "G5/G6 Mobile", hardwareVersion: nil, firmwareVersion: nil, softwareVersion: String(CGMBLEKitVersionNumber), diff --git a/Loop/Managers/DeviceDataManager.swift b/Loop/Managers/DeviceDataManager.swift index 146ecc5d08..eaa78103e2 100644 --- a/Loop/Managers/DeviceDataManager.swift +++ b/Loop/Managers/DeviceDataManager.swift @@ -154,6 +154,10 @@ final class DeviceDataManager { self.lastTimerTick = Date() self.cgmManager?.fetchNewDataIfNeeded(with: self) { (result) in + if case .newData = result { + AnalyticsManager.shared.didFetchNewCGMData() + } + // TODO: Isolate to queue? self.cgmManager(self.cgmManager!, didUpdateWith: result) } @@ -188,7 +192,7 @@ final class DeviceDataManager { func updateTimerTickPreference() { queue.async { /// Controls the management of the RileyLink timer tick, which is a reliably-changing BLE - /// characteristic which can cause the app to wake. For most users, the G5 Transmitter and + /// characteristic which can cause the app to wake. For most users, the G5/G6 Transmitter and /// G4 Receiver are reliable as hearbeats, but users who find their resources extremely constrained /// due to greedy apps or older devices may choose to always enable the timer by always setting `true` self.rileyLinkManager.timerTickEnabled = self.isPumpDataStale() || !(self.cgmManager?.providesBLEHeartbeat == true) @@ -487,6 +491,16 @@ final class DeviceDataManager { return } + // Check if the clock should be reset + if abs(date.timeIntervalSinceNow) > .seconds(20) { + self.logger.addError("Pump clock is more than 20 seconds off. Resetting.", fromSource: "RileyLink") + AnalyticsManager.shared.pumpTimeDidDrift(date.timeIntervalSinceNow) + try session.setTime { () -> DateComponents in + let calendar = Calendar(identifier: .gregorian) + return calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: Date()) + } + } + self.observeBatteryDuring { self.latestPumpStatus = status } @@ -840,18 +854,6 @@ extension DeviceDataManager: LoopDataManagerDelegate { return } - let notify = { (result: Result) -> Void in - // If we haven't fetched history in a while (preferredInsulinDataSource == .reservoir), - // let's try to do so while the pump radio is on. - if self.loopManager.doseStore.lastAddedPumpEvents.timeIntervalSinceNow < .minutes(-4) { - self.fetchPumpHistory { (_) in - completion(result) - } - } else { - completion(result) - } - } - pumpOps.runSession(withName: "Set Temp Basal", using: rileyLinkManager.firstConnectedDevice) { (session) in guard let session = session else { completion(.failure(LoopError.connectionError)) @@ -864,15 +866,43 @@ extension DeviceDataManager: LoopDataManagerDelegate { let now = Date() let endDate = now.addingTimeInterval(response.timeRemaining) let startDate = endDate.addingTimeInterval(-basal.recommendation.duration) - notify(.success(DoseEntry( + completion(.success(DoseEntry( type: .tempBasal, startDate: startDate, endDate: endDate, value: response.rate, unit: .unitsPerHour ))) + + // Continue below + } catch let error { + completion(.failure(error)) + return + } + + do { + // If we haven't fetched history in a while, our preferredInsulinDataSource is probably .reservoir, so + // let's take advantage of the pump radio being on. + if self.loopManager.doseStore.lastAddedPumpEvents.timeIntervalSinceNow < .minutes(-4) { + let clock = try session.getTime() + // Check if the clock should be reset + if let date = clock.date, abs(date.timeIntervalSinceNow) > .seconds(20) { + self.logger.addError("Pump clock is more than 20 seconds off. Resetting.", fromSource: "RileyLink") + AnalyticsManager.shared.pumpTimeDidDrift(date.timeIntervalSinceNow) + try session.setTime { () -> DateComponents in + let calendar = Calendar(identifier: .gregorian) + return calendar.dateComponents([.year, .month, .day, .hour, .minute, .second], from: Date()) + } + } + + self.fetchPumpHistory { (error) in + if let error = error { + self.logger.addError("Post-basal history fetch failed: \(error)", fromSource: "RileyLink") + } + } + } } catch let error { - notify(.failure(error)) + self.logger.addError("Post-basal time sync failed: \(error)", fromSource: "RileyLink") } } } diff --git a/Loop/Managers/LoopDataManager.swift b/Loop/Managers/LoopDataManager.swift index 75abd492c3..61a076ace0 100644 --- a/Loop/Managers/LoopDataManager.swift +++ b/Loop/Managers/LoopDataManager.swift @@ -24,6 +24,7 @@ final class LoopDataManager { } static let LoopUpdateContextKey = "com.loudnate.Loop.LoopDataManager.LoopUpdateContext" + static let LastLoopCompletedKey = "com.loopkit.Loop.LoopDataManager.LastLoopCompleted" fileprivate typealias GlucoseChange = (start: GlucoseValue, end: GlucoseValue) @@ -134,13 +135,6 @@ final class LoopDataManager { } } - /// Disable any active workout glucose targets - func disableWorkoutMode() { - settings.glucoseTargetRangeSchedule?.clearOverride() - - notify(forChange: .preferences) - } - /// The length of time insulin has an effect on blood glucose var insulinModelSettings: InsulinModelSettings? { get { @@ -299,7 +293,7 @@ final class LoopDataManager { do { try self.update() - completion(.success(try self.recommendBolus())) + completion(.success(self.recommendedBolus?.recommendation)) } catch let error { completion(.failure(error)) } @@ -586,7 +580,7 @@ final class LoopDataManager { if predictedGlucose == nil { do { - try updatePredictedGlucoseAndRecommendedBasal() + try updatePredictedGlucoseAndRecommendedBasalAndBolus() } catch let error { logger.error(error) @@ -596,9 +590,17 @@ final class LoopDataManager { } private func notify(forChange context: LoopUpdateContext) { + var userInfo: [String: Any] = [ + type(of: self).LoopUpdateContextKey: context.rawValue + ] + + if let lastLoopCompleted = lastLoopCompleted { + userInfo[type(of: self).LastLoopCompletedKey] = lastLoopCompleted + } + NotificationCenter.default.post(name: .LoopDataUpdated, object: self, - userInfo: [type(of: self).LoopUpdateContextKey: context.rawValue] + userInfo: userInfo ) } @@ -717,6 +719,7 @@ final class LoopDataManager { fileprivate var predictedGlucose: [GlucoseValue]? { didSet { recommendedTempBasal = nil + recommendedBolus = nil } } fileprivate var retrospectivePredictedGlucose: [GlucoseValue]? { @@ -726,6 +729,8 @@ final class LoopDataManager { } fileprivate var recommendedTempBasal: (recommendation: TempBasalRecommendation, date: Date)? + fileprivate var recommendedBolus: (recommendation: BolusRecommendation, date: Date)? + fileprivate var carbsOnBoard: CarbValue? fileprivate var lastTempBasal: DoseEntry? @@ -841,7 +846,7 @@ final class LoopDataManager { /// - LoopError.glucoseTooOld /// - LoopError.missingDataError /// - LoopError.pumpDataTooOld - private func updatePredictedGlucoseAndRecommendedBasal() throws { + private func updatePredictedGlucoseAndRecommendedBasalAndBolus() throws { dispatchPrecondition(condition: .onQueue(dataAccessQueue)) guard let glucose = glucoseStore.latestGlucose else { @@ -879,58 +884,40 @@ final class LoopDataManager { let glucoseTargetRange = settings.glucoseTargetRangeSchedule, let insulinSensitivity = insulinSensitivitySchedule, let basalRates = basalRateSchedule, + let maxBolus = settings.maximumBolus, let model = insulinModelSettings?.model else { throw LoopError.configurationError("Check settings") } - - guard - lastRequestedBolus == nil, // Don't recommend changes if a bolus was just set - let tempBasal = predictedGlucose.recommendedTempBasal( - to: glucoseTargetRange, - suspendThreshold: settings.suspendThreshold?.quantity, - sensitivity: insulinSensitivity, - model: model, - basalRates: basalRates, - maxBasalRate: maxBasal, - lastTempBasal: lastTempBasal - ) + + guard lastRequestedBolus == nil else { + // Don't recommend changes if a bolus was just requested. + // Sending additional pump commands is not going to be + // successful in any case. + recommendedBolus = nil recommendedTempBasal = nil return } - - recommendedTempBasal = (recommendation: tempBasal, date: Date()) - } - - /// - Returns: A bolus recommendation from the current data - /// - Throws: - /// - LoopError.configurationError - /// - LoopError.glucoseTooOld - /// - LoopError.missingDataError - fileprivate func recommendBolus() throws -> BolusRecommendation { - dispatchPrecondition(condition: .onQueue(dataAccessQueue)) - - guard - let predictedGlucose = predictedGlucose, - let maxBolus = settings.maximumBolus, - let glucoseTargetRange = settings.glucoseTargetRangeSchedule, - let insulinSensitivity = insulinSensitivitySchedule, - let model = insulinModelSettings?.model - else { - throw LoopError.configurationError("Check Settings") - } - - guard let glucoseDate = predictedGlucose.first?.startDate else { - throw LoopError.missingDataError(details: "No glucose data found", recovery: "Check your CGM source") - } - - guard abs(glucoseDate.timeIntervalSinceNow) <= recencyInterval else { - throw LoopError.glucoseTooOld(date: glucoseDate) + + let tempBasal = predictedGlucose.recommendedTempBasal( + to: glucoseTargetRange, + suspendThreshold: settings.suspendThreshold?.quantity, + sensitivity: insulinSensitivity, + model: model, + basalRates: basalRates, + maxBasalRate: maxBasal, + lastTempBasal: lastTempBasal + ) + + if let temp = tempBasal { + recommendedTempBasal = (recommendation: temp, date: startDate) + } else { + recommendedTempBasal = nil } let pendingInsulin = try self.getPendingInsulin() - + let recommendation = predictedGlucose.recommendedBolus( to: glucoseTargetRange, suspendThreshold: settings.suspendThreshold?.quantity, @@ -939,8 +926,7 @@ final class LoopDataManager { pendingInsulin: pendingInsulin, maxBolus: maxBolus ) - - return recommendation + recommendedBolus = (recommendation: recommendation, date: startDate) } /// *This method should only be called from the `dataAccessQueue`* @@ -997,6 +983,8 @@ protocol LoopState { /// The recommended temp basal based on predicted glucose var recommendedTempBasal: (recommendation: TempBasalRecommendation, date: Date)? { get } + var recommendedBolus: (recommendation: BolusRecommendation, date: Date)? { get } + /// The retrospective prediction over a recent period of glucose samples var retrospectivePredictedGlucose: [GlucoseValue]? { get } @@ -1008,15 +996,6 @@ protocol LoopState { /// - Returns: An timeline of predicted glucose values /// - Throws: LoopError.missingDataError if prediction cannot be computed func predictGlucose(using inputs: PredictionInputEffect) throws -> [GlucoseValue] - - /// Calculates a recommended bolus based on predicted glucose - /// - /// - Returns: A bolus recommendation - /// - Throws: An error describing why a bolus couldnʼt be computed - /// - LoopError.configurationError - /// - LoopError.glucoseTooOld - /// - LoopError.missingDataError - func recommendBolus() throws -> BolusRecommendation } @@ -1064,6 +1043,11 @@ extension LoopDataManager { dispatchPrecondition(condition: .onQueue(loopDataManager.dataAccessQueue)) return loopDataManager.recommendedTempBasal } + + var recommendedBolus: (recommendation: BolusRecommendation, date: Date)? { + dispatchPrecondition(condition: .onQueue(loopDataManager.dataAccessQueue)) + return loopDataManager.recommendedBolus + } var retrospectivePredictedGlucose: [GlucoseValue]? { dispatchPrecondition(condition: .onQueue(loopDataManager.dataAccessQueue)) @@ -1073,10 +1057,6 @@ extension LoopDataManager { func predictGlucose(using inputs: PredictionInputEffect) throws -> [GlucoseValue] { return try loopDataManager.predictGlucose(using: inputs) } - - func recommendBolus() throws -> BolusRecommendation { - return try loopDataManager.recommendBolus() - } } /// Executes a closure with access to the current state of the loop. @@ -1118,6 +1098,7 @@ extension LoopDataManager { "predictedGlucose: \(state.predictedGlucose ?? [])", "retrospectivePredictedGlucose: \(state.retrospectivePredictedGlucose ?? [])", "recommendedTempBasal: \(String(describing: state.recommendedTempBasal))", + "recommendedBolus: \(String(describing: state.recommendedBolus))", "lastBolus: \(String(describing: manager.lastRequestedBolus))", "lastGlucoseChange: \(String(describing: manager.lastGlucoseChange))", "retrospectiveGlucoseChange: \(String(describing: manager.retrospectiveGlucoseChange))", diff --git a/Loop/Managers/NightscoutDataManager.swift b/Loop/Managers/NightscoutDataManager.swift index 5e7706cce4..a773507f84 100644 --- a/Loop/Managers/NightscoutDataManager.swift +++ b/Loop/Managers/NightscoutDataManager.swift @@ -43,15 +43,7 @@ final class NightscoutDataManager { var loopError = state.error let recommendedBolus: Double? - do { - recommendedBolus = try state.recommendBolus().amount - } catch let error { - recommendedBolus = nil - - if loopError == nil { - loopError = error - } - } + recommendedBolus = state.recommendedBolus?.recommendation.amount let carbsOnBoard = state.carbsOnBoard let predictedGlucose = state.predictedGlucose diff --git a/Loop/Managers/WatchDataManager.swift b/Loop/Managers/WatchDataManager.swift index 44255cd80f..a20a326050 100644 --- a/Loop/Managers/WatchDataManager.swift +++ b/Loop/Managers/WatchDataManager.swift @@ -125,7 +125,7 @@ final class WatchDataManager: NSObject, WCSessionDelegate { context.reservoir = reservoir?.unitVolume context.loopLastRunDate = state.lastLoopCompleted - context.recommendedBolusDose = try? state.recommendBolus().amount + context.recommendedBolusDose = state.recommendedBolus?.recommendation.amount context.maxBolus = manager.settings.maximumBolus if let glucoseTargetRangeSchedule = manager.settings.glucoseTargetRangeSchedule { diff --git a/Loop/Models/CGM.swift b/Loop/Models/CGM.swift index ea0488b5be..43710351a4 100644 --- a/Loop/Models/CGM.swift +++ b/Loop/Models/CGM.swift @@ -17,8 +17,15 @@ enum CGM { switch self { case .g4: return URL(string: "dexcomshare://") - case .g5: - return URL(string: "dexcomcgm://") + case .g5(let transmitterID): + if let transmitterID = transmitterID { + if transmitterID.hasPrefix("4") { + return URL(string: "dexcomcgm://") + } else { + return URL(string: "dexcomg6://") + } + } + return nil case .enlite: return nil } diff --git a/Loop/Models/Glucose.swift b/Loop/Models/Glucose.swift index dc614aecef..791ba627f9 100644 --- a/Loop/Models/Glucose.swift +++ b/Loop/Models/Glucose.swift @@ -22,7 +22,7 @@ extension Glucose: SensorDisplayable { case .ok: status = "" case .lowBattery: - status = NSLocalizedString("Low Battery", comment: "The description of a low G5 transmitter battery with a leading space") + status = NSLocalizedString("Low Battery", comment: "The description of a low G5/G6 transmitter battery with a leading space") case .unknown(let value): status = String(format: "%02x", value) } diff --git a/Loop/Models/ServiceAuthentication/AmplitudeService.swift b/Loop/Models/ServiceAuthentication/AmplitudeService.swift index f9a2e496d4..47d388d73e 100644 --- a/Loop/Models/ServiceAuthentication/AmplitudeService.swift +++ b/Loop/Models/ServiceAuthentication/AmplitudeService.swift @@ -46,6 +46,7 @@ class AmplitudeService: ServiceAuthentication { isAuthorized = true let client = Amplitude() + client.disableIdfaTracking() client.disableLocationListening() client.initializeApiKey(APIKey) self.client = client diff --git a/Loop/Models/ShareGlucose+GlucoseKit.swift b/Loop/Models/ShareGlucose+GlucoseKit.swift index f0854785a1..8b1e46294c 100644 --- a/Loop/Models/ShareGlucose+GlucoseKit.swift +++ b/Loop/Models/ShareGlucose+GlucoseKit.swift @@ -26,7 +26,7 @@ extension ShareGlucose: GlucoseValue { extension ShareGlucose: SensorDisplayable { public var isStateValid: Bool { - return glucose >= 20 + return glucose >= 39 } public var trendType: GlucoseTrend? { diff --git a/Loop/View Controllers/BolusViewController+LoopDataManager.swift b/Loop/View Controllers/BolusViewController+LoopDataManager.swift index 280d333530..84246ef882 100644 --- a/Loop/View Controllers/BolusViewController+LoopDataManager.swift +++ b/Loop/View Controllers/BolusViewController+LoopDataManager.swift @@ -20,7 +20,7 @@ extension BolusViewController { if let recommendation = recommendation { bolusRecommendation = recommendation } else { - bolusRecommendation = try? state.recommendBolus() + bolusRecommendation = state.recommendedBolus?.recommendation } manager.doseStore.insulinOnBoard(at: Date()) { (result) in diff --git a/Loop/View Controllers/SettingsTableViewController.swift b/Loop/View Controllers/SettingsTableViewController.swift index 660b64fe18..9965adefdb 100644 --- a/Loop/View Controllers/SettingsTableViewController.swift +++ b/Loop/View Controllers/SettingsTableViewController.swift @@ -231,7 +231,7 @@ final class SettingsTableViewController: UITableViewController, DailyValueSchedu case .g5TransmitterID: let configCell = tableView.dequeueReusableCell(withIdentifier: ConfigCellIdentifier, for: indexPath) - configCell.textLabel?.text = NSLocalizedString("Transmitter ID", comment: "The title text for the Dexcom G5 transmitter ID config value") + configCell.textLabel?.text = NSLocalizedString("Transmitter ID", comment: "The title text for the Dexcom G5/G6 transmitter ID config value") if case .g5(let transmitterID)? = dataManager.cgm { configCell.detailTextLabel?.text = transmitterID ?? TapToSetString @@ -257,7 +257,7 @@ final class SettingsTableViewController: UITableViewController, DailyValueSchedu switchCell.switch?.isOn = false } - switchCell.textLabel?.text = NSLocalizedString("G5 Transmitter", comment: "The title text for the G5 Transmitter switch cell") + switchCell.textLabel?.text = NSLocalizedString("G5/G6 Transmitter", comment: "The title text for the G5/G6 Transmitter switch cell") switchCell.switch?.addTarget(self, action: #selector(g5Changed(_:)), for: .valueChanged) case .dexcomShare, .g5TransmitterID: assertionFailure() diff --git a/Loop/View Controllers/StatusTableViewController.swift b/Loop/View Controllers/StatusTableViewController.swift index 09713870d2..0d690ffcf0 100644 --- a/Loop/View Controllers/StatusTableViewController.swift +++ b/Loop/View Controllers/StatusTableViewController.swift @@ -46,6 +46,7 @@ final class StatusTableViewController: ChartsTableViewController { notificationObservers += [ notificationCenter.addObserver(forName: .LoopDataUpdated, object: deviceManager.loopManager, queue: nil) { [unowned self] note in let context = note.userInfo?[LoopDataManager.LoopUpdateContextKey] as! LoopDataManager.LoopUpdateContext.RawValue + let lastLoopCompleted = note.userInfo?[LoopDataManager.LastLoopCompletedKey] as? Date DispatchQueue.main.async { switch LoopDataManager.LoopUpdateContext(rawValue: context) { case .none, .bolus?: @@ -58,6 +59,10 @@ final class StatusTableViewController: ChartsTableViewController { self.refreshContext.formUnion([.glucose, .carbs]) case .tempBasal?: self.refreshContext.update(with: .insulin) + + if let lastLoopCompleted = lastLoopCompleted { + self.hudView?.loopCompletionHUD.lastLoopCompleted = lastLoopCompleted + } } self.hudView?.loopCompletionHUD.loopInProgress = false diff --git a/Loop/View Controllers/TextFieldTableViewController.swift b/Loop/View Controllers/TextFieldTableViewController.swift index e59b5e5a5c..96bb4e433b 100644 --- a/Loop/View Controllers/TextFieldTableViewController.swift +++ b/Loop/View Controllers/TextFieldTableViewController.swift @@ -40,7 +40,7 @@ extension TextFieldTableViewController { vc.placeholder = NSLocalizedString("Enter the 6-digit transmitter ID", comment: "The placeholder text instructing users how to enter a pump ID") vc.value = value - vc.contextHelp = NSLocalizedString("The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app.", comment: "Instructions on where to find the transmitter ID") + vc.contextHelp = NSLocalizedString("The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app.", comment: "Instructions on where to find the transmitter ID") return vc } diff --git a/Loop/es.lproj/Localizable.strings b/Loop/es.lproj/Localizable.strings index e2cd8898d7..817888c970 100644 --- a/Loop/es.lproj/Localizable.strings +++ b/Loop/es.lproj/Localizable.strings @@ -184,7 +184,7 @@ "G4 Share Receiver" = "Receptor G4 Share"; /* The title text for the G5 Transmitter switch cell */ -"G5 Transmitter" = "Transmisor G5"; +"G5/G6 Transmitter" = "Transmisor G5/G6"; /* The title of the glucose and prediction graph */ "Glucose" = "Glucosa"; @@ -389,7 +389,7 @@ "The pump region can be found printed on the back as part of the model number (REF), for example: MMT-551NAB, or MMT-515LWWS. If the model number contains \"NA\" or \"CA\", then the region is North America. If if contains \"WW\", then the region is World-Wide." = "La región de la microinfusora puede enconstrarse impresa en la parte trasera como parte del código de modelo ( REF ), por ejemplo MMT-551NAB o MMT-515LWWS. Si el código de modelo contiene \"NA\" o \"CA\", la región es Norte América. Si contiene \"WW\" la región es Mundial."; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "El ID de transmisor puede encontrarse impreso en la parte trasera del dispositivo, a un lado de la caja en la que estaba empacado y dentro del menú de ajustes del receptor G5 y la app móvil"; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "El ID de transmisor puede encontrarse impreso en la parte trasera del dispositivo, a un lado de la caja en la que estaba empacado y dentro del menú de ajustes del receptor y la app móvil"; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Esto incrementará o decrementará mas agresivamente la entrega de basales cuando el movimiento de glucosa no concuerde con el modelo de insulina y carbohidratos."; diff --git a/Loop/it.lproj/Localizable.strings b/Loop/it.lproj/Localizable.strings index 26ebc1abb9..c72c4a1cd8 100644 --- a/Loop/it.lproj/Localizable.strings +++ b/Loop/it.lproj/Localizable.strings @@ -181,7 +181,7 @@ "G4 Share Receiver" = "G4 Ricevitore Share"; /* The title text for the Dexcom G5 transmitter ID config value */ -"G5 Transmitter ID" = "G5 ID Trasmettitore"; +"G5/G6 Transmitter ID" = "G5/G6 ID Trasmettitore"; /* The title of the glucose and prediction graph */ "Glucose" = "Glicemie"; @@ -328,7 +328,7 @@ "The pump ID can be found printed on the back, or near the bottom of the STATUS/Esc screen. It is the strictly numerical portion of the serial number (shown as SN or S/N)." = "L'ID della pompa si trova stampato sul retro, o vicino al fondo della schermata STATO/Esc. È la parte strettamente numerica del numero di serie (indicato come SN o S/N)."; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "L'ID trasmettitore può essere trovato stampato sul retro del dispositivo, sul lato della scatola, e all'interno del menu impostazione del ricevitore G5 all'interno dell'applicazione mobile."; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "L'ID trasmettitore può essere trovato stampato sul retro del dispositivo, sul lato della scatola, e all'interno del menu impostazione del ricevitore all'interno dell'applicazione mobile."; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Questo sarà più aggressivo all'aumentare o al diminuire della basale quando il movimento di glucosio non corrisponde al modello di carboidrati e al modello insulino-basale"; diff --git a/Loop/ru.lproj/Localizable.strings b/Loop/ru.lproj/Localizable.strings index dde228ab29..69c52f9c02 100644 --- a/Loop/ru.lproj/Localizable.strings +++ b/Loop/ru.lproj/Localizable.strings @@ -197,7 +197,7 @@ "G4 Share Receiver" = "Ресивер G4 Шеар"; /* The title text for the G5 Transmitter switch cell */ -"G5 Transmitter" = "Трансмиттер G5"; +"G5/G6 Transmitter" = "Трансмиттер G5/G6"; /* The title of the glucose and prediction graph */ "Glucose" = "Гликемия"; @@ -254,7 +254,7 @@ /* The notification alert describing a long-lasting loop failure. The substitution parameter is the time interval since the last loop */ "Loop has not completed successfully in %@" = "Ну удалось успешно замкнуть цикл/контур в %@"; -/* The description of a low G5 transmitter battery with a leading space */ +/* The description of a low transmitter battery with a leading space */ "Low Battery" = "Низкий заряд батареи"; /* The title text for the maximum basal rate value */ @@ -399,7 +399,7 @@ "The pump ID can be found printed on the back, or near the bottom of the STATUS/Esc screen. It is the strictly numerical portion of the serial number (shown as SN or S/N)." = "инд номер помпы находится на ее задней стенке или снизу экрана состояния STATUS/ESC. Это исключительно цифровая часть серийного номера (обозначаемого SN или S/N) "; /* Instructions on where to find the transmitter ID */ -"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the G5 receiver and mobile app." = "Инд. номер трансмиттера находится на задней стенке устройства , сбоку упаковочной коробки, в настроечном меню ресивера G5 и мобильного приложения"; +"The transmitter ID can be found printed on the back of the device, on the side of the box it came in, and from within the settings menus of the receiver and mobile app." = "Инд. номер трансмиттера находится на задней стенке устройства , сбоку упаковочной коробки, в настроечном меню ресивера и мобильного приложения"; /* The description of the switch which toggles retrospective correction effects */ "This will more aggresively increase or decrease basal delivery when glucose movement doesn't match the carbohydrate and insulin-based model." = "Это более радикально понизит или увеличит подачу базала в тех случаях когда динамика гликемии не соответствует моделям основанным на углеводах и инсулине"; diff --git a/LoopTests/Info.plist b/LoopTests/Info.plist index 5bd34daaf6..6d86f6a299 100644 --- a/LoopTests/Info.plist +++ b/LoopTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleSignature ???? CFBundleVersion diff --git a/LoopUI/Info.plist b/LoopUI/Info.plist index 3ac46b5881..6d29dddc6f 100644 --- a/LoopUI/Info.plist +++ b/LoopUI/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/LoopUI/Views/LoopCompletionHUDView.swift b/LoopUI/Views/LoopCompletionHUDView.swift index 11f1fb3364..313b94e67b 100644 --- a/LoopUI/Views/LoopCompletionHUDView.swift +++ b/LoopUI/Views/LoopCompletionHUDView.swift @@ -95,7 +95,7 @@ public final class LoopCompletionHUDView: BaseHUDView { ) updateTimer = timer - RunLoop.main.add(timer, forMode: RunLoopMode.defaultRunLoopMode) + RunLoop.main.add(timer, forMode: .defaultRunLoopMode) } private var updateTimer: Timer? { diff --git a/WatchApp Extension/ExtensionDelegate.swift b/WatchApp Extension/ExtensionDelegate.swift index 2e76860093..6d3ccada38 100644 --- a/WatchApp Extension/ExtensionDelegate.swift +++ b/WatchApp Extension/ExtensionDelegate.swift @@ -8,6 +8,7 @@ import WatchConnectivity import WatchKit +import HealthKit import os import UserNotifications @@ -152,10 +153,23 @@ final class ExtensionDelegate: NSObject, WKExtensionDelegate { } } + private lazy var healthStore = HKHealthStore() + fileprivate func updateContext(_ data: [String: Any]) { if let context = WatchContext(rawValue: data as WatchContext.RawValue) { - DispatchQueue.main.async { - self.lastContext = context + if context.preferredGlucoseUnit == nil { + let type = HKQuantityType.quantityType(forIdentifier: .bloodGlucose)! + healthStore.preferredUnits(for: [type]) { (units, error) in + context.preferredGlucoseUnit = units[type] + + DispatchQueue.main.async { + self.lastContext = context + } + } + } else { + DispatchQueue.main.async { + self.lastContext = context + } } } } diff --git a/WatchApp Extension/Info.plist b/WatchApp Extension/Info.plist index 2d920e1e05..b550c08541 100644 --- a/WatchApp Extension/Info.plist +++ b/WatchApp Extension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleSignature ???? CFBundleVersion diff --git a/WatchApp/Info.plist b/WatchApp/Info.plist index 1f9804bde7..4123828ce1 100644 --- a/WatchApp/Info.plist +++ b/WatchApp/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.4 + 1.5.6 CFBundleSignature ???? CFBundleVersion