Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cb69c01
[COASTAL-1291] plugin identifier is no longer class property (#4)
nhamming Sep 25, 2023
6467115
[COASTAL-1291] plugin identifier is no longer class property (#4)
nhamming Sep 25, 2023
0d95b09
Merge remote-tracking branch 'origin/main' into ps2/LOOP-4735/cgm-eve…
ps2 Sep 27, 2023
5fea10f
Merge remote-tracking branch 'origin/main' into ps2/LOOP-4735/cgm-eve…
ps2 Sep 27, 2023
8132229
Merge pull request #5 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
c3439c4
Merge pull request #5 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
0c1bd09
Types moved to LoopAlgorithm
ps2 Mar 1, 2024
6167732
Types moved to LoopAlgorithm
ps2 Mar 1, 2024
0d1dbbd
Merge pull request #6 from tidepool-org/ps2/LOOP-4781/algorithm-package
ps2 Mar 5, 2024
8458d60
Merge pull request #6 from tidepool-org/ps2/LOOP-4781/algorithm-package
ps2 Mar 5, 2024
3452e9d
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
1660ad3
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
a210253
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
f7c4c6e
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
15cb4b1
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
b175ec8
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
f71f690
Bump to iOS 17
Camji55 Dec 6, 2024
e91bc45
Bump to iOS 17
Camji55 Dec 6, 2024
0034550
Bump to iOS 17
Camji55 Dec 9, 2024
db9a867
Bump to iOS 17
Camji55 Dec 9, 2024
bbc7145
[LOOP-5280] Display Glucose Preference by InternationalUnit
Camji55 Apr 7, 2025
bbe3c7a
[LOOP-5280] Display Glucose Preference by InternationalUnit
Camji55 Apr 7, 2025
2e68886
[LOOP-5280] Display Glucose Preference by InternationalUnit
Camji55 Apr 8, 2025
39d4820
[LOOP-5280] Display Glucose Preference by InternationalUnit
Camji55 Apr 8, 2025
4a4f427
Changes for protocol updates
ps2 Jul 24, 2025
d90b27f
Changes for protocol updates
ps2 Jul 24, 2025
50d3b38
Merge pull request #10 from tidepool-org/ps2/LOOP-5235/enable-schedul…
ps2 Jul 29, 2025
e1348b4
Merge pull request #10 from tidepool-org/ps2/LOOP-5235/enable-schedul…
ps2 Jul 29, 2025
77e01a5
[LOOP-5496] adding loop status checks (#11)
nhamming Oct 24, 2025
181c684
[LOOP-5496] adding loop status checks (#11)
nhamming Oct 24, 2025
4b850b0
Merge tidepool/main into tidepool-sync/2026-03-10
loopkitdev Mar 10, 2026
32e4b88
Merge remote-tracking branch 'upstream/main' into tidepool-sync/2026-…
loopkitdev Apr 9, 2026
468eefc
Merge tidepool/main into tidepool-sync/2026-05-11
ps2 May 11, 2026
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
20 changes: 0 additions & 20 deletions Common/HKUnit.swift

This file was deleted.

10 changes: 2 additions & 8 deletions G7SensorKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
C10760812F05B41B008B2B39 /* ExtendedVersionMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C10760802F05B412008B2B39 /* ExtendedVersionMessageTests.swift */; };
C109F14A291ECCE2008EA5B6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C109F149291ECCE2008EA5B6 /* Assets.xcassets */; };
C109F14C291ED66F008EA5B6 /* G7GlucoseMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C109F14B291ED66F008EA5B6 /* G7GlucoseMessageTests.swift */; };
C139829829295D7D0047DB5F /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F514A291EB6F000555EB5 /* HKUnit.swift */; };
C1409A07291EC21C006BE8D0 /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F5126291EAF2F00555EB5 /* OSLog.swift */; };
C1409A09291EC22F006BE8D0 /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1409A08291EC22F006BE8D0 /* OSLog.swift */; };
C1409A0B291EC258006BE8D0 /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1409A0A291EC258006BE8D0 /* OSLog.swift */; };
Expand Down Expand Up @@ -54,7 +53,6 @@
C17F5145291EB45900555EB5 /* CBPeripheral.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F5144291EB45900555EB5 /* CBPeripheral.swift */; };
C17F5147291EB57700555EB5 /* SensorMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F5146291EB57700555EB5 /* SensorMessage.swift */; };
C17F5149291EB6B600555EB5 /* LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F5148291EB6B600555EB5 /* LocalizedString.swift */; };
C17F514B291EB6F000555EB5 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F514A291EB6F000555EB5 /* HKUnit.swift */; };
C17F514D291EB79E00555EB5 /* AlgorithmError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F514C291EB79E00555EB5 /* AlgorithmError.swift */; };
C17F514F291EB87600555EB5 /* G7SensorKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C17F50C6291EAC3800555EB5 /* G7SensorKit.framework */; };
C17F5156291EBD8600555EB5 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17F5155291EBD8600555EB5 /* Image.swift */; };
Expand Down Expand Up @@ -155,7 +153,6 @@
C17F5144291EB45900555EB5 /* CBPeripheral.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CBPeripheral.swift; sourceTree = "<group>"; };
C17F5146291EB57700555EB5 /* SensorMessage.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; fileEncoding = 4; path = SensorMessage.swift; sourceTree = "<group>"; };
C17F5148291EB6B600555EB5 /* LocalizedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalizedString.swift; sourceTree = "<group>"; };
C17F514A291EB6F000555EB5 /* HKUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HKUnit.swift; sourceTree = "<group>"; };
C17F514C291EB79E00555EB5 /* AlgorithmError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlgorithmError.swift; sourceTree = "<group>"; };
C17F5155291EBD8600555EB5 /* Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
C17F5158291EBE7500555EB5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -315,7 +312,6 @@
C17F5137291EB0A800555EB5 /* Data.swift */,
C17F5148291EB6B600555EB5 /* LocalizedString.swift */,
C17F513B291EB13D00555EB5 /* Locked.swift */,
C17F514A291EB6F000555EB5 /* HKUnit.swift */,
C17F513F291EB27D00555EB5 /* TimeInterval.swift */,
);
path = Common;
Expand Down Expand Up @@ -585,7 +581,6 @@
C17F5135291EB06A00555EB5 /* AlgorithmState.swift in Sources */,
C17F50F1291EAC6500555EB5 /* G7BluetoothManager.swift in Sources */,
C17F5138291EB0A800555EB5 /* Data.swift in Sources */,
C17F514B291EB6F000555EB5 /* HKUnit.swift in Sources */,
C17F50EC291EAC6500555EB5 /* G7LastReading.swift in Sources */,
C17F513C291EB13D00555EB5 /* Locked.swift in Sources */,
C17F513E291EB1A500555EB5 /* BluetoothServices.swift in Sources */,
Expand Down Expand Up @@ -616,7 +611,6 @@
C17F5157291EBD9900555EB5 /* TimeInterval.swift in Sources */,
C19C9F4E29C91C4C00A6D3D0 /* LocalizedString.swift in Sources */,
C17F5156291EBD8600555EB5 /* Image.swift in Sources */,
C139829829295D7D0047DB5F /* HKUnit.swift in Sources */,
C1409A07291EC21C006BE8D0 /* OSLog.swift in Sources */,
C17F510A291EAC9D00555EB5 /* G7UICoordinator.swift in Sources */,
C17F5109291EAC9D00555EB5 /* G7CGMManager+UI.swift in Sources */,
Expand Down Expand Up @@ -712,7 +706,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_MACRO_NAMES = (
NSLocalizedString,
Expand Down Expand Up @@ -775,7 +769,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.6;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
LOCALIZED_STRING_MACRO_NAMES = (
NSLocalizedString,
Expand Down
1 change: 1 addition & 0 deletions G7SensorKit/G7CGMManager/G7BackfillMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import LoopKit
import LoopAlgorithm

public struct G7BackfillMessage: Equatable {

Expand Down
35 changes: 20 additions & 15 deletions G7SensorKit/G7CGMManager/G7CGMManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
//

import Foundation
import HealthKit
import LoopAlgorithm
import LoopKit
import os.log
import HealthKit



Expand All @@ -19,6 +20,12 @@ public protocol G7StateObserver: AnyObject {
}

public class G7CGMManager: CGMManager {
public var inSignalLoss: Bool = false

public var isInoperable: Bool {
cgmManagerStatus.isInoperable
}

private let log = OSLog(category: "G7CGMManager")

public var state: G7CGMManagerState {
Expand Down Expand Up @@ -233,14 +240,12 @@ public class G7CGMManager: CGMManager {
return lines.joined(separator: "\n")
}

public func acknowledgeAlert(alertIdentifier: LoopKit.Alert.AlertIdentifier, completion: @escaping (Error?) -> Void) {
completion(nil)
}
public func acknowledgeAlert(alertIdentifier: Alert.AlertIdentifier) async throws { }

public func getSoundBaseURL() -> URL? { return nil }
public func getSounds() -> [Alert.Sound] { return [] }

public static let pluginIdentifier: String = "G7CGMManager"
public let pluginIdentifier: String = "G7CGMManager"

public let localizedTitle = LocalizedString("Dexcom G7", comment: "CGM display title")

Expand Down Expand Up @@ -395,8 +400,8 @@ extension G7CGMManager: G7SensorDelegate {
return
}

let unit = HKUnit.milligramsPerDeciliter
let quantity = HKQuantity(unit: unit, doubleValue: Double(min(max(glucose, GlucoseLimits.minimum), GlucoseLimits.maximum)))
let unit = LoopUnit.milligramsPerDeciliter
let quantity = LoopQuantity(unit: unit, doubleValue: Double(min(max(glucose, GlucoseLimits.minimum), GlucoseLimits.maximum)))

updateDelegate(with: .newData([
NewGlucoseSample(
Expand Down Expand Up @@ -431,7 +436,7 @@ extension G7CGMManager: G7SensorDelegate {
return
}

let unit = HKUnit.milligramsPerDeciliter
let unit = LoopUnit.milligramsPerDeciliter

let samples = backfill.compactMap { entry -> NewGlucoseSample? in
guard let glucose = entry.glucose else {
Expand All @@ -443,7 +448,7 @@ extension G7CGMManager: G7SensorDelegate {
return nil
}

let quantity = HKQuantity(unit: unit, doubleValue: Double(min(max(glucose, GlucoseLimits.minimum), GlucoseLimits.maximum)))
let quantity = LoopQuantity(unit: unit, doubleValue: Double(min(max(glucose, GlucoseLimits.minimum), GlucoseLimits.maximum)))

return NewGlucoseSample(
date: activationDate.addingTimeInterval(TimeInterval(entry.timestamp)),
Expand All @@ -469,11 +474,11 @@ extension G7CGMManager: G7SensorDelegate {
}

extension G7BackfillMessage {
public var trendRate: HKQuantity? {
public var trendRate: LoopQuantity? {
guard let trend = trend else {
return nil
}
return HKQuantity(unit: .milligramsPerDeciliterPerMinute, doubleValue: trend)
return LoopQuantity(unit: .milligramsPerDeciliterPerMinute, doubleValue: trend)
}
}

Expand All @@ -482,18 +487,18 @@ extension G7GlucoseMessage: GlucoseDisplayable {
return hasReliableGlucose
}

public var trendRate: HKQuantity? {
public var trendRate: LoopQuantity? {
guard let trend = trend else {
return nil
}
return HKQuantity(unit: .milligramsPerDeciliterPerMinute, doubleValue: trend)
return LoopQuantity(unit: .milligramsPerDeciliterPerMinute, doubleValue: trend)
}

public var glucoseQuantity: HKQuantity? {
public var glucoseQuantity: LoopQuantity? {
guard let glucose = glucose else {
return nil
}
return HKQuantity(unit: .milligramsPerDeciliter, doubleValue: Double(glucose))
return LoopQuantity(unit: .milligramsPerDeciliter, doubleValue: Double(glucose))
}

public var isLocal: Bool {
Expand Down
1 change: 0 additions & 1 deletion G7SensorKit/G7CGMManager/G7Sensor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import Foundation
import CoreBluetooth
import HealthKit
import os.log


Expand Down
1 change: 1 addition & 0 deletions G7SensorKit/Messages/G7GlucoseMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import LoopKit
import LoopAlgorithm

public struct G7GlucoseMessage: SensorMessage, Equatable {
//public let status: UInt8
Expand Down
3 changes: 1 addition & 2 deletions G7SensorKitUI/Views/G7SettingsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Foundation
import G7SensorKit
import LoopKit
import LoopKitUI
import HealthKit

public enum ColorStyle {
case glucose, warning, critical, normal, dimmed
Expand Down Expand Up @@ -191,7 +190,7 @@ class G7SettingsViewModel: ObservableObject {

var lastGlucoseTrendString: String {
if let lastReading = lastReading, lastReading.hasReliableGlucose, let trendRate = lastReading.trendRate {
return displayGlucosePreference.minuteRateFormatter.string(from: trendRate)!
return displayGlucosePreference.formatMinuteRate(trendRate)
} else {
return ""
}
Expand Down