Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
03876bf
[COASTAL-1291] plugin identifier is no longer class property (#39)
nhamming Sep 25, 2023
34a825e
[COASTAL-1291] plugin identifier is no longer class property (#39)
nhamming Sep 25, 2023
f574461
Merge remote-tracking branch 'origin/dev' into ps2/LOOP-4735/cgm-even…
ps2 Sep 27, 2023
649e57c
Merge remote-tracking branch 'origin/dev' into ps2/LOOP-4735/cgm-even…
ps2 Sep 27, 2023
349939c
Merge pull request #40 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
d64b29e
Merge pull request #40 from tidepool-org/ps2/LOOP-4735/cgm-event-store
ps2 Sep 27, 2023
5b9e011
Updates for LOOP-4752
ps2 Dec 12, 2023
8f2f54e
Updates for LOOP-4752
ps2 Dec 12, 2023
5fe26bb
Update for remote data service protocol changes
ps2 May 23, 2024
1e1b519
Update for remote data service protocol changes
ps2 May 23, 2024
c57e96d
Remote data service can fetch device logs
ps2 Jun 4, 2024
b50a1c3
Remote data service can fetch device logs
ps2 Jun 4, 2024
d9df12b
Merge pull request #41 from tidepool-org/ps2/LOOP-1169/upload-device-…
ps2 Jun 10, 2024
25d67ff
Merge pull request #41 from tidepool-org/ps2/LOOP-1169/upload-device-…
ps2 Jun 10, 2024
ad08c3e
service allowDebugFeatures (#42)
nhamming Oct 30, 2024
a70df07
service allowDebugFeatures (#42)
nhamming Oct 30, 2024
025d019
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
8f8e29c
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 21, 2024
3e26a2c
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
209fd87
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Nov 22, 2024
0564c4d
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
22068c3
[LOOP-5153] Remove HealthKit dependency from LoopAlgorithm
Camji55 Dec 4, 2024
78c2452
Bump to iOS 17
Camji55 Dec 6, 2024
9bf39cc
Bump to iOS 17
Camji55 Dec 6, 2024
074e478
Bump to iOS 17
Camji55 Dec 9, 2024
53eeb07
Bump to iOS 17
Camji55 Dec 9, 2024
4ff860d
Type name updates
ps2 Apr 24, 2025
1470036
Type name updates
ps2 Apr 24, 2025
b601589
Merge pull request #45 from tidepool-org/ps2/LOOP-5315/edit-custom-pr…
ps2 Apr 24, 2025
ee87de4
Merge pull request #45 from tidepool-org/ps2/LOOP-5315/edit-custom-pr…
ps2 Apr 24, 2025
39c5a80
[LOOP-5295] decisionId on DoseEntry and PersistedPumpEvent
Camji55 Jun 2, 2025
dd069d8
[LOOP-5295] decisionId on DoseEntry and PersistedPumpEvent
Camji55 Jun 2, 2025
cc3e64b
[LOOP-5295] decisionId on DoseEntry and PersistedPumpEvent
Camji55 Jun 6, 2025
482419c
[LOOP-5295] decisionId on DoseEntry and PersistedPumpEvent
Camji55 Jun 6, 2025
36f3282
[LOOP-5295] enactedTempBasal updates to StoredDosingDecision
Camji55 Jun 17, 2025
fb53825
[LOOP-5295] enactedTempBasal updates to StoredDosingDecision
Camji55 Jun 17, 2025
3728c7d
[LOOP-5295] enactedTempBasal updates to StoredDosingDecision
Camji55 Jun 20, 2025
0ed7a87
[LOOP-5295] enactedTempBasal updates to StoredDosingDecision
Camji55 Jun 20, 2025
a772869
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
19203c7
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
1e555d7
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
f6aebe7
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
746df17
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
2ad3eb8
[LOOP-5405] Remove Legacy Workout Preset
Camji55 Aug 21, 2025
5ba403c
Merge tidepool/dev into tidepool-sync/2026-03-10
loopkitdev Mar 10, 2026
00eadd1
Merge pull request #22 from LoopKit/translations
marionbarker Mar 27, 2026
9ec985f
Merge remote-tracking branch 'upstream/dev' into tidepool-sync/2026-0…
loopkitdev Apr 9, 2026
219314a
Update string catalogs from Xcode build after Tidepool sync
loopkitdev Apr 9, 2026
e569941
Merge remote-tracking branch 'origin/dev' into tidepool-sync/2026-05-11
ps2 May 11, 2026
09dc797
Merge tidepool/dev 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
8 changes: 2 additions & 6 deletions NightscoutService.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
A90E39A122BC773A0016DFE8 /* NightscoutUploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90E39A022BC773A0016DFE8 /* NightscoutUploader.swift */; };
A90E39A322BC782C0016DFE8 /* SyncCarbObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90E39A222BC782C0016DFE8 /* SyncCarbObject.swift */; };
A90E39A522BC791E0016DFE8 /* DoseEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90E39A422BC791E0016DFE8 /* DoseEntry.swift */; };
A90E39A722BC7A360016DFE8 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90E39A622BC7A360016DFE8 /* HKUnit.swift */; };
A90E39A922BC7AD10016DFE8 /* Bundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A90E39A822BC7AD10016DFE8 /* Bundle.swift */; };
A91BAC2522BC691A00ABF1BB /* NightscoutServiceKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A91BAC1B22BC691A00ABF1BB /* NightscoutServiceKit.framework */; };
A91BAC2C22BC691A00ABF1BB /* NightscoutServiceKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A91BAC1E22BC691A00ABF1BB /* NightscoutServiceKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -145,7 +144,6 @@
A90E39A022BC773A0016DFE8 /* NightscoutUploader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutUploader.swift; sourceTree = "<group>"; };
A90E39A222BC782C0016DFE8 /* SyncCarbObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncCarbObject.swift; sourceTree = "<group>"; };
A90E39A422BC791E0016DFE8 /* DoseEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoseEntry.swift; sourceTree = "<group>"; };
A90E39A622BC7A360016DFE8 /* HKUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HKUnit.swift; sourceTree = "<group>"; };
A90E39A822BC7AD10016DFE8 /* Bundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Bundle.swift; sourceTree = "<group>"; };
A91BAC1B22BC691A00ABF1BB /* NightscoutServiceKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NightscoutServiceKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A91BAC1E22BC691A00ABF1BB /* NightscoutServiceKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NightscoutServiceKit.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -259,7 +257,6 @@
isa = PBXGroup;
children = (
A90E39A422BC791E0016DFE8 /* DoseEntry.swift */,
A90E39A622BC7A360016DFE8 /* HKUnit.swift */,
A90E39A022BC773A0016DFE8 /* NightscoutUploader.swift */,
C1F7822727CD57A100C0919A /* OverrideTreament.swift */,
C177C4512ABE2D8900911B56 /* PersistedCgmEvent.swift */,
Expand Down Expand Up @@ -729,7 +726,6 @@
A941B08929BCB99C00F91340 /* RemoteCommandValidator.swift in Sources */,
C1398D2027C41E3D00416AD6 /* ProfileSet.swift in Sources */,
A9AA6E6329EB07D7008FFA78 /* Action.swift in Sources */,
A90E39A722BC7A360016DFE8 /* HKUnit.swift in Sources */,
A99A115E29AA28EE007919CE /* RemoteCommandSourceV1.swift in Sources */,
A9246B2526231B3A00CCDCB3 /* OTPManager.swift in Sources */,
A90E399E22BC76DB0016DFE8 /* TimeInterval.swift in Sources */,
Expand Down Expand Up @@ -919,7 +915,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 @@ -1025,7 +1021,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
25 changes: 0 additions & 25 deletions NightscoutServiceKit/Extensions/HKUnit.swift

This file was deleted.

18 changes: 11 additions & 7 deletions NightscoutServiceKit/Extensions/OverrideTreament.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
//

import Foundation
import NightscoutKit
import LoopAlgorithm
import LoopKit
import HealthKit
import NightscoutKit

extension OverrideTreatment {
convenience init(override: LoopKit.TemporaryScheduleOverride) {

// NS Treatments should be in mg/dL
let unit: HKUnit = .milligramsPerDeciliter
let unit: LoopUnit = .milligramsPerDeciliter

let nsTargetRange: ClosedRange<Double>?
if let targetRange = override.settings.targetRange {
Expand All @@ -30,12 +30,16 @@ extension OverrideTreatment {
switch override.context {
case .custom:
reason = NSLocalizedString("Custom Override", comment: "Name of custom override")
case .legacyWorkout:
reason = NSLocalizedString("Workout", comment: "Name of legacy workout override")
case .activity(let activity):
reason = activity.activityType.name + NSLocalizedString("Activity", comment: "Suffix added to the name of an activity override")
case .preMeal:
reason = NSLocalizedString("Pre-Meal", comment: "Name of pre-meal workout override")
reason = NSLocalizedString("Pre-Meal", comment: "Name of pre-meal override")
case .preset(let preset):
reason = preset.symbol + " " + preset.name
if let symbol = preset.symbol, symbol.symbolType == .emoji {
reason = symbol.value + " " + preset.name
} else {
reason = preset.name
}
}

let remoteAddress: String?
Expand Down
35 changes: 17 additions & 18 deletions NightscoutServiceKit/Extensions/ProfileSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
//

import Foundation
import NightscoutKit
import LoopAlgorithm
import LoopKit
import HealthKit
import NightscoutKit

private extension HKUnit {
static func glucoseUnitFromNightscoutUnitString(_ unitString: String) -> HKUnit? {
private extension LoopUnit {
static func glucoseUnitFromNightscoutUnitString(_ unitString: String) -> LoopUnit? {
// Some versions of Loop incorrectly uploaded units with
// special characters to avoid line breaking.
if unitString == HKUnit.millimolesPerLiter.shortLocalizedUnitString() ||
unitString == HKUnit.millimolesPerLiter.shortLocalizedUnitString(avoidLineBreaking: false)
if unitString == LoopUnit.millimolesPerLiter.shortLocalizedUnitString() ||
unitString == LoopUnit.millimolesPerLiter.shortLocalizedUnitString(avoidLineBreaking: false)
{
return .millimolesPerLiter
}

if unitString == HKUnit.milligramsPerDeciliter.shortLocalizedUnitString() ||
unitString == HKUnit.milligramsPerDeciliter.shortLocalizedUnitString(avoidLineBreaking: false)
if unitString == LoopUnit.milligramsPerDeciliter.shortLocalizedUnitString() ||
unitString == LoopUnit.milligramsPerDeciliter.shortLocalizedUnitString(avoidLineBreaking: false)
{
return .milligramsPerDeciliter
}
Expand All @@ -36,14 +36,14 @@ extension ProfileSet {

guard let profile = store["Default"],
let glucoseSafetyLimit = settings.minimumBGGuard,
let settingsGlucoseUnit = HKUnit.glucoseUnitFromNightscoutUnitString(units)
let settingsGlucoseUnit = LoopUnit.glucoseUnitFromNightscoutUnitString(units)
else {
return nil
}

// If units are specified on the schedule, prefer those over the units specified on the ProfileSet
let scheduleGlucoseUnit: HKUnit
if let profileUnitString = profile.units, let profileUnit = HKUnit.glucoseUnitFromNightscoutUnitString(profileUnitString)
let scheduleGlucoseUnit: LoopUnit
if let profileUnitString = profile.units, let profileUnit = LoopUnit.glucoseUnitFromNightscoutUnitString(profileUnitString)
{
scheduleGlucoseUnit = profileUnit
} else {
Expand All @@ -59,8 +59,7 @@ extension ProfileSet {
let correctionRangeOverrides: CorrectionRangeOverrides?
if let range = settings.preMealTargetRange {
correctionRangeOverrides = CorrectionRangeOverrides(
preMeal: GlucoseRange(minValue: range.lowerBound, maxValue: range.upperBound, unit: settingsGlucoseUnit),
workout: nil // No longer used
preMeal: GlucoseRange(minValue: range.lowerBound, maxValue: range.upperBound, unit: settingsGlucoseUnit)
)
} else {
correctionRangeOverrides = nil
Expand All @@ -76,7 +75,7 @@ extension ProfileSet {
timeZone: profile.timeZone)

let carbSchedule = CarbRatioSchedule(
unit: .gram(),
unit: .gram,
dailyItems: profile.carbratio.map { RepeatingScheduleValue(startTime: $0.offset, value: $0.value) },
timeZone: profile.timeZone)

Expand All @@ -98,7 +97,7 @@ extension ProfileSet {

extension NightscoutKit.TemporaryScheduleOverride {

func loopOverride(for unit: HKUnit) -> LoopKit.TemporaryScheduleOverridePreset? {
func loopOverride(for unit: LoopUnit) -> LoopKit.TemporaryPreset? {
guard let name = name,
let symbol = symbol
else {
Expand All @@ -114,7 +113,7 @@ extension NightscoutKit.TemporaryScheduleOverride {
target = nil
}

let temporaryOverrideSettings = TemporaryScheduleOverrideSettings(
let temporaryOverrideSettings = TemporaryPresetSettings(
unit: unit,
targetRange: target,
insulinNeedsScaleFactor: insulinNeedsScaleFactor)
Expand All @@ -127,8 +126,8 @@ extension NightscoutKit.TemporaryScheduleOverride {
loopDuration = .finite(duration)
}

return TemporaryScheduleOverridePreset(
symbol: symbol,
return TemporaryPreset(
symbol: .emoji(symbol),
name: name,
settings: temporaryOverrideSettings,
duration: loopDuration)
Expand Down
36 changes: 19 additions & 17 deletions NightscoutServiceKit/Extensions/StoredDosingDecision.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
import NightscoutKit

Expand All @@ -24,28 +24,25 @@ extension StoredDosingDecision {
guard let carbsOnBoard = carbsOnBoard else {
return nil
}
return COBStatus(cob: carbsOnBoard.quantity.doubleValue(for: HKUnit.gram()), timestamp: carbsOnBoard.startDate)
return COBStatus(cob: carbsOnBoard.quantity.doubleValue(for: LoopUnit.gram), timestamp: carbsOnBoard.startDate)
}

var loopStatusPredicted: PredictedBG? {
guard let predictedGlucose = predictedGlucose, let startDate = predictedGlucose.first?.startDate else {
return nil
}
return PredictedBG(startDate: startDate, values: predictedGlucose.map { $0.quantity })
return PredictedBG(startDate: startDate, values: predictedGlucose.map { $0.quantity.hkQuantity })
}

var loopStatusAutomaticDoseRecommendation: NightscoutKit.AutomaticDoseRecommendation? {
guard let automaticDoseRecommendation = automaticDoseRecommendation else {
return nil
}

let nightscoutTempBasalAdjustment: TempBasalAdjustment?

if let basalAdjustment = automaticDoseRecommendation.basalAdjustment {
nightscoutTempBasalAdjustment = TempBasalAdjustment(rate: basalAdjustment.unitsPerHour, duration: basalAdjustment.duration)
} else {
nightscoutTempBasalAdjustment = nil
}
let nightscoutTempBasalAdjustment = TempBasalAdjustment(
rate: automaticDoseRecommendation.basalAdjustment.unitsPerHour,
duration: automaticDoseRecommendation.basalAdjustment.duration
)

return NightscoutKit.AutomaticDoseRecommendation(
timestamp: date,
Expand All @@ -61,12 +58,17 @@ extension StoredDosingDecision {
}

var loopStatusEnacted: LoopEnacted? {
guard let automaticDoseRecommendation = automaticDoseRecommendation, errors.isEmpty else {
guard errors.isEmpty else {
return nil
}
let tempBasal = automaticDoseRecommendation.basalAdjustment
// NS needs to be updated to support an "enacted" field with no rate. Once that happens, we should not report a fake cancel here, and rate/duration should be nil instead of 0
return LoopEnacted(rate: tempBasal?.unitsPerHour ?? 0, duration: tempBasal?.duration ?? 0, timestamp: date, received: true, bolusVolume: automaticDoseRecommendation.bolusUnits ?? 0)
return LoopEnacted(
rate: enactedTempBasal?.unitsPerHour ?? 0,
duration: enactedTempBasal?.duration ?? 0,
timestamp: date,
received: true,
bolusVolume: enactedBolusAmount ?? 0
)
}

var loopStatusFailureReason: String? {
Expand Down Expand Up @@ -122,10 +124,10 @@ extension StoredDosingDecision {
return NightscoutKit.OverrideStatus(timestamp: date, active: false)
}

let unit = glucoseTargetRangeSchedule?.unit ?? HKUnit.milligramsPerDeciliter
let lowerTarget = HKQuantity(unit: unit, doubleValue: glucoseTargetRange.minValue)
let upperTarget = HKQuantity(unit: unit, doubleValue: glucoseTargetRange.maxValue)
let currentCorrectionRange = CorrectionRange(minValue: lowerTarget, maxValue: upperTarget)
let unit = glucoseTargetRangeSchedule?.unit ?? LoopUnit.milligramsPerDeciliter
let lowerTarget = LoopQuantity(unit: unit, doubleValue: glucoseTargetRange.minValue)
let upperTarget = LoopQuantity(unit: unit, doubleValue: glucoseTargetRange.maxValue)
let currentCorrectionRange = CorrectionRange(minValue: lowerTarget.hkQuantity, maxValue: upperTarget.hkQuantity)
let duration = scheduleOverride.duration != .indefinite ? round(scheduleOverride.actualEndDate.timeIntervalSince(date)): nil

return NightscoutKit.OverrideStatus(name: scheduleOverride.context.name,
Expand Down
5 changes: 2 additions & 3 deletions NightscoutServiceKit/Extensions/StoredSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2019 LoopKit Authors. All rights reserved.
//

import HealthKit
import LoopKit
import NightscoutKit

Expand Down Expand Up @@ -49,8 +48,8 @@ extension StoredSettings {

return NightscoutKit.LoopSettings(
dosingEnabled: dosingEnabled,
overridePresets: overridePresets?.map { $0.nsScheduleOverride(for: bloodGlucoseUnit) } ?? [],
scheduleOverride: scheduleOverride?.nsScheduleOverride(for: bloodGlucoseUnit),
overridePresets: overridePresets.map { $0.nsScheduleOverride(for: bloodGlucoseUnit) },
scheduleOverride: nil,
minimumBGGuard: suspendThreshold?.quantity.doubleValue(for: bloodGlucoseUnit),
preMealTargetRange: nightscoutPreMealTargetRange,
maximumBasalRatePerHour: maximumBasalRatePerHour,
Expand Down
1 change: 0 additions & 1 deletion NightscoutServiceKit/Extensions/SyncCarbObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import Foundation
import LoopKit
import NightscoutKit
import HealthKit

extension SyncCarbObject {

Expand Down
23 changes: 13 additions & 10 deletions NightscoutServiceKit/Extensions/TemporaryScheduleOverride.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// Copyright © 2019 LoopKit Authors. All rights reserved.
//

import HealthKit
import LoopAlgorithm
import LoopKit
import NightscoutKit

extension LoopKit.TemporaryScheduleOverride {

func nsScheduleOverride(for unit: HKUnit) -> NightscoutKit.TemporaryScheduleOverride {
func nsScheduleOverride(for unit: LoopUnit) -> NightscoutKit.TemporaryScheduleOverride {
let nsTargetRange: ClosedRange<Double>?
if let targetRange = settings.targetRange {
nsTargetRange = ClosedRange(uncheckedBounds: (
Expand All @@ -34,7 +34,7 @@ extension LoopKit.TemporaryScheduleOverride {
duration: nsDuration,
targetRange: nsTargetRange,
insulinNeedsScaleFactor: settings.insulinNeedsScaleFactor,
symbol: context.symbol,
symbol: context.symbol?.textualRepresentation,
name: context.name)
}

Expand All @@ -46,29 +46,31 @@ extension LoopKit.TemporaryScheduleOverride.Context {
switch self {
case .custom:
return nil
case .legacyWorkout:
return LocalizedString("Workout", comment: "Name uploaded to Nightscout for legacy workout override")
case .activity(let activity):
return activity.preset.name
case .preMeal:
return LocalizedString("Pre-Meal", comment: "Name uploaded to Nightscout for Pre-Meal override")
case .preset(let preset):
return preset.name
}
}

var symbol: String? {
var symbol: PresetSymbol? {
switch self {
case .preset(let preset):
return preset.symbol
case .activity(let activity):
return activity.preset.symbol
default:
return nil
}
}

}

extension LoopKit.TemporaryScheduleOverridePreset {
extension LoopKit.TemporaryPreset {

func nsScheduleOverride(for unit: HKUnit) -> NightscoutKit.TemporaryScheduleOverride {
func nsScheduleOverride(for unit: LoopUnit) -> NightscoutKit.TemporaryScheduleOverride {
let nsTargetRange: ClosedRange<Double>?
if let targetRange = settings.targetRange {
nsTargetRange = ClosedRange(uncheckedBounds: (
Expand All @@ -90,8 +92,9 @@ extension LoopKit.TemporaryScheduleOverridePreset {
duration: nsDuration,
targetRange: nsTargetRange,
insulinNeedsScaleFactor: settings.insulinNeedsScaleFactor,
symbol: self.symbol,
name: self.name)
symbol: self.symbol?.textualRepresentation,
name: self.name
)
}

}
Loading