Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1517e20
[COASTAL-1291] plugin identifier is no longer class property (#3)
nhamming Sep 25, 2023
7eed641
[COASTAL-1291] plugin identifier is no longer class property (#3)
nhamming Sep 25, 2023
9c03f3a
Merge remote-tracking branch 'origin/main' into ps2/LOOP-4735/cgm-eve…
ps2 Sep 27, 2023
593b655
Merge remote-tracking branch 'origin/main' into ps2/LOOP-4735/cgm-eve…
ps2 Sep 27, 2023
a93f929
Merge pull request #4 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
c916b21
Merge pull request #4 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
875b87c
Types moved to LoopAlgorithm
ps2 Mar 1, 2024
abddd5c
Types moved to LoopAlgorithm
ps2 Mar 1, 2024
8a7f816
Merge pull request #5 from tidepool-org/ps2/LOOP-4781/algorithm-package
ps2 Mar 5, 2024
046fbe9
Merge pull request #5 from tidepool-org/ps2/LOOP-4781/algorithm-package
ps2 Mar 5, 2024
c632c23
[PAL-615] Scenario Loading Fixes
Camji55 May 24, 2024
0e05401
[PAL-615] Scenario Loading Fixes
Camji55 May 24, 2024
81f9b80
[PAL-615] Scenario Loading Fixes
Camji55 May 24, 2024
9293f5a
[PAL-615] Scenario Loading Fixes
Camji55 May 24, 2024
21d91f2
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
9ec7235
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
34e29d4
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
c2bee4d
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
390fec9
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 3, 2024
3d0f746
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 3, 2024
e4a0f08
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
15ac63f
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
eea34ea
Bump to iOS 17
Camji55 Dec 6, 2024
a4c0757
Bump to iOS 17
Camji55 Dec 6, 2024
a68bf1b
Bump to iOS 17
Camji55 Dec 9, 2024
c877249
Bump to iOS 17
Camji55 Dec 9, 2024
2e3c40a
[LOOP-5496] adding loop status checks (#10)
nhamming Oct 24, 2025
1c69e22
[LOOP-5496] adding loop status checks (#10)
nhamming Oct 24, 2025
bc017fb
Merge tidepool/main into tidepool-sync/2026-03-10
loopkitdev Mar 10, 2026
8b28ff5
Merge pull request #37 from LoopKit/translations
marionbarker Mar 27, 2026
6704962
Update string catalogs from Xcode build after Tidepool sync
loopkitdev Apr 9, 2026
2f485e2
Merge remote-tracking branch 'upstream/main' into tidepool-sync/2026-…
loopkitdev Apr 9, 2026
c8e70d0
Merge remote-tracking branch 'origin/main' into tidepool-sync/2026-05-11
ps2 May 11, 2026
356824b
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
33 changes: 0 additions & 33 deletions Common/HKUnit.swift

This file was deleted.

20 changes: 10 additions & 10 deletions Common/Settings/GlucoseSchedules.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

import Foundation
import HealthKit
// import MiaomiaoClient
import LoopAlgorithm

public enum GlucoseScheduleAlarmResult: Int, CaseIterable {
case none = 0
case low
Expand Down Expand Up @@ -175,18 +175,18 @@ class GlucoseSchedule: Codable, CustomStringConvertible {
}
// stores the alarm. It does not synhronize the value with the underlaying userdefaults
// that is up to the caller of this class
public func storeLowAlarm(forUnit unit: HKUnit, lowAlarm: Double) {
if unit == HKUnit.millimolesPerLiter {
public func storeLowAlarm(forUnit unit: LoopUnit, lowAlarm: Double) {
if unit == LoopUnit.millimolesPerLiter {
self.lowAlarm = lowAlarm * 18
return
}

self.lowAlarm = lowAlarm
}

public func retrieveLowAlarm(forUnit unit: HKUnit) -> Double? {
public func retrieveLowAlarm(forUnit unit: LoopUnit) -> Double? {
if let lowAlarm = self.lowAlarm {
if unit == HKUnit.millimolesPerLiter {
if unit == LoopUnit.millimolesPerLiter {
return (lowAlarm / 18).roundTo(places: 1)
} else {
return lowAlarm
Expand All @@ -198,17 +198,17 @@ class GlucoseSchedule: Codable, CustomStringConvertible {

// stores the alarm. It does not synhronize the value with the underlaying userdefaults
// that is up to the caller of this class
public func storeHighAlarm(forUnit unit: HKUnit, highAlarm: Double) {
if unit == HKUnit.millimolesPerLiter {
public func storeHighAlarm(forUnit unit: LoopUnit, highAlarm: Double) {
if unit == .millimolesPerLiter {
self.highAlarm = highAlarm * 18
return
}

self.highAlarm = highAlarm
}
public func retrieveHighAlarm(forUnit unit: HKUnit) -> Double? {
public func retrieveHighAlarm(forUnit unit: LoopUnit) -> Double? {
if let highAlarm = self.highAlarm {
if unit == HKUnit.millimolesPerLiter {
if unit == .millimolesPerLiter {
return (highAlarm / 18).roundTo(places: 1)
}
return highAlarm
Expand Down
12 changes: 6 additions & 6 deletions Common/Settings/UserDefaults+Alarmsettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import HealthKit
import LoopAlgorithm

extension UserDefaults {
private enum Key: String {
Expand Down Expand Up @@ -135,22 +135,22 @@ extension UserDefaults {
}

// intentionally only supports mgdl and mmol
var mmGlucoseUnit: HKUnit? {
var mmGlucoseUnit: LoopUnit? {
get {
if let textUnit = string(forKey: Key.mmGlucoseUnit.rawValue) {
if textUnit == "mmol" {
return HKUnit.millimolesPerLiter
return LoopUnit.millimolesPerLiter
} else if textUnit == "mgdl" {
return HKUnit.milligramsPerDeciliter
return LoopUnit.milligramsPerDeciliter
}
}

return nil
}
set {
if newValue == HKUnit.milligramsPerDeciliter {
if newValue == LoopUnit.milligramsPerDeciliter {
set("mgdl", forKey: Key.mmGlucoseUnit.rawValue)
} else if newValue == HKUnit.millimolesPerLiter {
} else if newValue == LoopUnit.millimolesPerLiter {
set("mmol", forKey: Key.mmGlucoseUnit.rawValue)
}
}
Expand Down
1 change: 0 additions & 1 deletion Common/Settings/UserDefaults+GlucoseSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Foundation
import HealthKit

extension UserDefaults {
private enum Key: String {
Expand Down
18 changes: 0 additions & 18 deletions LibreDemoPlugin/Extensions/HKUnit.swift

This file was deleted.

7 changes: 5 additions & 2 deletions LibreDemoPlugin/LibreDemoCGMManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
//

import Foundation
import HealthKit
import LibreTransmitter
import LibreTransmitterUI
import LoopKit
import LoopKitUI
import HealthKit
import LoopAlgorithm
import os.log
import LoopTestingKit

Expand All @@ -22,6 +23,8 @@ class LibreDemoCGMManager: LibreTransmitterManagerV3 {


override var localizedTitle: String { "Libre Demo" }

public var autoStartTrace: Bool = false

public var managerIdentifier: String {
"LibreDemoCGMManager"
Expand Down Expand Up @@ -60,7 +63,7 @@ class LibreDemoCGMManager: LibreTransmitterManagerV3 {
private func reportMockSample() {
let date = Date()
let value = 110.0 + sin(date.timeIntervalSinceReferenceDate.truncatingRemainder(dividingBy: 3600 * 5) / (3600*5) * Double.pi * 2) * 60
let quantity = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: value)
let quantity = LoopQuantity(unit: .milligramsPerDeciliter, doubleValue: value)
let newSample = NewGlucoseSample(
date: date,
quantity: quantity,
Expand Down
21 changes: 2 additions & 19 deletions LibreTransmitter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
27850CFA25672C0C0020D109 /* UIApplication+metadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850CE325672C0C0020D109 /* UIApplication+metadata.swift */; };
27850CFB25672C0C0020D109 /* GlucoseSchedules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850CE425672C0C0020D109 /* GlucoseSchedules.swift */; };
27850CFC25672C0C0020D109 /* GlucoseSchedules.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850CE425672C0C0020D109 /* GlucoseSchedules.swift */; };
27850CFD25672C0C0020D109 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850CE525672C0C0020D109 /* HKUnit.swift */; };
27850CFE25672C0C0020D109 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850CE525672C0C0020D109 /* HKUnit.swift */; };
27850D0E25672CA60020D109 /* ConcreteGlucoseDisplayable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850D0B25672CA60020D109 /* ConcreteGlucoseDisplayable.swift */; };
27850D1025672CA60020D109 /* LibreGlucose.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850D0C25672CA60020D109 /* LibreGlucose.swift */; };
27850D1225672CA60020D109 /* NotificationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27850D0D25672CA60020D109 /* NotificationHelper.swift */; };
Expand Down Expand Up @@ -255,7 +253,6 @@
27850CE225672C0C0020D109 /* UserDefaults+Bluetooth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Bluetooth.swift"; sourceTree = "<group>"; };
27850CE325672C0C0020D109 /* UIApplication+metadata.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIApplication+metadata.swift"; sourceTree = "<group>"; };
27850CE425672C0C0020D109 /* GlucoseSchedules.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlucoseSchedules.swift; sourceTree = "<group>"; };
27850CE525672C0C0020D109 /* HKUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HKUnit.swift; sourceTree = "<group>"; };
27850D0B25672CA60020D109 /* ConcreteGlucoseDisplayable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConcreteGlucoseDisplayable.swift; sourceTree = "<group>"; };
27850D0C25672CA60020D109 /* LibreGlucose.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LibreGlucose.swift; sourceTree = "<group>"; };
27850D0D25672CA60020D109 /* NotificationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationHelper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -312,7 +309,6 @@
C1BDBAFD2A43992A00A787D1 /* LibreDemoCGMManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibreDemoCGMManager.swift; sourceTree = "<group>"; };
C1BDBAFE2A44FFD800A787D1 /* MockSensorPairingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockSensorPairingService.swift; sourceTree = "<group>"; };
C1C318CF2A4748A100C6F29F /* MockBluetoothSearcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockBluetoothSearcher.swift; sourceTree = "<group>"; };
C1C318D82A478E0000C6F29F /* HKUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HKUnit.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -649,7 +645,6 @@
isa = PBXGroup;
children = (
27850CD825672C0C0020D109 /* Extensions */,
27850CE525672C0C0020D109 /* HKUnit.swift */,
27850CDE25672C0C0020D109 /* LocalizedString.swift */,
27850CDF25672C0C0020D109 /* Settings */,
);
Expand All @@ -669,7 +664,6 @@
C1AF1D132A4BC22A00F46A26 /* Extensions */ = {
isa = PBXGroup;
children = (
C1C318D82A478E0000C6F29F /* HKUnit.swift */,
C1AF1D142A4BC23D00F46A26 /* TimeInterval.swift */,
);
path = Extensions;
Expand Down Expand Up @@ -990,7 +984,6 @@
27850DCF25672F780020D109 /* CRC.swift in Sources */,
2764E86126FC6DC10016A585 /* Features.swift in Sources */,
27ED67B82698EF38003E5DAB /* AlarmStatus.swift in Sources */,
27850CFD25672C0C0020D109 /* HKUnit.swift in Sources */,
27850CF925672C0C0020D109 /* UIApplication+metadata.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -1002,7 +995,6 @@
274E71D52986D4A600FCFECD /* CriticalAlarmsVolumeView.swift in Sources */,
2746C74226DD0F8800E31BD9 /* Libre2DirectSetup.swift in Sources */,
27ED67BA26990D6B003E5DAB /* GenericObservableObject.swift in Sources */,
27850CFE25672C0C0020D109 /* HKUnit.swift in Sources */,
27850D4E25672DFB0020D109 /* LibreTransmitterSetupViewController.swift in Sources */,
276EF5F22652F84F00571021 /* HashableClass.swift in Sources */,
27850CF825672C0C0020D109 /* UserDefaults+Bluetooth.swift in Sources */,
Expand Down Expand Up @@ -1049,7 +1041,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C1C318D92A478E0000C6F29F /* HKUnit.swift in Sources */,
C1AF1D152A4BC23D00F46A26 /* TimeInterval.swift in Sources */,
C1BDBAED2A4397E200A787D1 /* OSLog.swift in Sources */,
C1BDBB002A45051B00A787D1 /* LibreDemoPlugin.swift in Sources */,
Expand Down Expand Up @@ -1141,7 +1132,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = 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 @@ -1207,7 +1198,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = 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 @@ -1242,7 +1233,6 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = LibreTransmitter/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1275,7 +1265,6 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = LibreTransmitter/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1315,7 +1304,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = LibreTransmitterUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1356,7 +1344,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = LibreTransmitterUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1389,7 +1376,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = LibreTransmitterPlugin/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1427,7 +1413,6 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = LibreTransmitterPlugin/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1464,7 +1449,6 @@
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_NSPrincipalClass = LibreDemoPlugin;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -1503,7 +1487,6 @@
INFOPLIST_FILE = Info.plist;
INFOPLIST_KEY_NSPrincipalClass = LibreDemoPlugin;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
4 changes: 2 additions & 2 deletions LibreTransmitter/ConcreteGlucoseDisplayable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import HealthKit
import LoopAlgorithm
import LoopKit

public struct ConcreteGlucoseDisplayable: GlucoseDisplayable {
Expand All @@ -21,5 +21,5 @@ public struct ConcreteGlucoseDisplayable: GlucoseDisplayable {

// public var batteries : [(name: String, percentage: Int)]?

public var trendRate: HKQuantity? { nil }
public var trendRate: LoopQuantity? { nil }
}
4 changes: 2 additions & 2 deletions LibreTransmitter/LibreGlucose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//

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

private var logger = Logger(forType: "LibreGlucose")

Expand Down Expand Up @@ -51,7 +51,7 @@ extension LibreGlucose: GlucoseValue {
timestamp
}

public var quantity: HKQuantity {
public var quantity: LoopQuantity {
.init(unit: .milligramsPerDeciliter, doubleValue: glucoseDouble)
}
}
Expand Down
Loading