Skip to content

Commit f72870c

Browse files
authored
Merge pull request #512 from tidepool-org/ps2/LOOP-4116/diy-sync
LOOP-4116
2 parents d461191 + ddb76eb commit f72870c

File tree

125 files changed

+3737
-1151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+3737
-1151
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

Cartfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ github "LoopKit/LogglyService" "dev"
1111
github "LoopKit/MKRingProgressView" "appex-safe"
1212
github "dexman/Minizip" "master"
1313
github "instacart/TrueTime.swift"
14+
github "gestrich/NightscoutAPIClient" "dev"

Cartfile.resolved

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ github "i-schuetz/SwiftCharts" "0.6.5"
1212
github "instacart/TrueTime.swift" "5.1.0"
1313
github "ps2/NightscoutService" "f54ae00a3c362ccbcbac403b86bc6cd7320c9058"
1414
github "ps2/rileylink_ios" "0badcaca8c42a0a6cc430302a04133412cbbef58"
15+
github "gestrich/NightscoutAPIClient" "2a9dd24772db59c4aa528d1fb33e2c37a320fb13"

Common/Extensions/NSBundle.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ extension Bundle {
8585
}
8686
}
8787

88+
// These strings are only configured if it is a workspace build
89+
var workspaceGitRevision: String? {
90+
return object(forInfoDictionaryKey: "com-loopkit-LoopWorkspace-git-revision") as? String
91+
}
92+
93+
var workspaceGitBranch: String? {
94+
return object(forInfoDictionaryKey: "com-loopkit-LoopWorkspace-git-branch") as? String
95+
}
96+
8897
var localCacheDuration: TimeInterval {
8998
guard let localCacheDurationDaysString = object(forInfoDictionaryKey: "LoopLocalCacheDurationDays") as? String,
9099
let localCacheDurationDays = Double(localCacheDurationDaysString) else {

Common/Extensions/OSLog.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
import os.log
99

1010

11+
extension Logger {
12+
init(category: String) {
13+
self.init(subsystem: "com.loopkit.Loop", category: category)
14+
}
15+
}
16+
1117
extension OSLog {
1218
convenience init(category: String) {
1319
self.init(subsystem: "com.loopkit.Loop", category: category)

Common/Extensions/UserDefaults+CGM.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

Common/Extensions/UserDefaults+Services.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.

Common/FeatureFlags.swift

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ struct FeatureFlagConfiguration: Decodable {
1616
let criticalAlertsEnabled: Bool
1717
let entryDeletionEnabled: Bool
1818
let fiaspInsulinModelEnabled: Bool
19+
let lyumjevInsulinModelEnabled: Bool
20+
let afrezzaInsulinModelEnabled: Bool
1921
let includeServicesInSettingsEnabled: Bool
2022
let manualDoseEntryEnabled: Bool
2123
let insulinDeliveryReservoirViewEnabled: Bool
2224
let mockTherapySettingsEnabled: Bool
2325
let nonlinearCarbModelEnabled: Bool
24-
let observeHealthKitSamplesFromOtherApps: Bool
26+
let observeHealthKitCarbSamplesFromOtherApps: Bool
27+
let observeHealthKitDoseSamplesFromOtherApps: Bool
28+
let observeHealthKitGlucoseSamplesFromOtherApps: Bool
2529
let remoteOverridesEnabled: Bool
2630
let predictedGlucoseChartClampEnabled: Bool
2731
let scenariosEnabled: Bool
@@ -71,6 +75,20 @@ struct FeatureFlagConfiguration: Decodable {
7175
#else
7276
self.fiaspInsulinModelEnabled = true
7377
#endif
78+
79+
// Swift compiler config is inverse, since the default state is enabled.
80+
#if LYUMJEV_INSULIN_MODEL_DISABLED
81+
self.lyumjevInsulinModelEnabled = false
82+
#else
83+
self.lyumjevInsulinModelEnabled = true
84+
#endif
85+
86+
// Swift compiler config is inverse, since the default state is enabled.
87+
#if AFREZZA_INSULIN_MODEL_DISABLED
88+
self.afrezzaInsulinModelEnabled = false
89+
#else
90+
self.afrezzaInsulinModelEnabled = true
91+
#endif
7492

7593
// Swift compiler config is inverse, since the default state is enabled.
7694
#if INCLUDE_SERVICES_IN_SETTINGS_DISABLED
@@ -93,7 +111,6 @@ struct FeatureFlagConfiguration: Decodable {
93111
self.insulinDeliveryReservoirViewEnabled = true
94112
#endif
95113

96-
// Swift compiler config is inverse, since the default state is enabled.
97114
#if MOCK_THERAPY_SETTINGS_ENABLED
98115
self.mockTherapySettingsEnabled = true
99116
#else
@@ -107,13 +124,31 @@ struct FeatureFlagConfiguration: Decodable {
107124
self.nonlinearCarbModelEnabled = true
108125
#endif
109126

127+
#if OBSERVE_HEALTH_KIT_CARB_SAMPLES_FROM_OTHER_APPS_ENABLED
128+
self.observeHealthKitCarbSamplesFromOtherApps = true
129+
#else
130+
self.observeHealthKitCarbSamplesFromOtherApps = false
131+
#endif
132+
110133
// Swift compiler config is inverse, since the default state is enabled.
111134
#if OBSERVE_HEALTH_KIT_SAMPLES_FROM_OTHER_APPS_DISABLED
112-
self.observeHealthKitSamplesFromOtherApps = false
135+
self.observeHealthKitDoseSamplesFromOtherApps = false
136+
self.observeHealthKitGlucoseSamplesFromOtherApps = false
113137
#else
114-
self.observeHealthKitSamplesFromOtherApps = true
138+
self.observeHealthKitDoseSamplesFromOtherApps = true
139+
self.observeHealthKitGlucoseSamplesFromOtherApps = true
140+
#endif
141+
142+
// Swift compiler config is inverse, since the default state is enabled.
143+
#if OBSERVE_HEALTH_KIT_DOSE_SAMPLES_FROM_OTHER_APPS_DISABLED
144+
self.observeHealthKitDoseSamplesFromOtherApps = false
115145
#endif
116146

147+
// Swift compiler config is inverse, since the default state is enabled.
148+
#if OBSERVE_HEALTH_KIT_GLUCOSE_SAMPLES_FROM_OTHER_APPS_DISABLED
149+
self.observeHealthKitGlucoseSamplesFromOtherApps = false
150+
#endif
151+
117152
#if PREDICTED_GLUCOSE_CHART_CLAMP_ENABLED
118153
self.predictedGlucoseChartClampEnabled = true
119154
#else
@@ -169,10 +204,14 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
169204
"* criticalAlertsEnabled: \(criticalAlertsEnabled)",
170205
"* entryDeletionEnabled: \(entryDeletionEnabled)",
171206
"* fiaspInsulinModelEnabled: \(fiaspInsulinModelEnabled)",
207+
"* lyumjevInsulinModelEnabled: \(lyumjevInsulinModelEnabled)",
208+
"* afrezzaInsulinModelEnabled: \(afrezzaInsulinModelEnabled)",
172209
"* includeServicesInSettingsEnabled: \(includeServicesInSettingsEnabled)",
173210
"* mockTherapySettingsEnabled: \(mockTherapySettingsEnabled)",
174211
"* nonlinearCarbModelEnabled: \(nonlinearCarbModelEnabled)",
175-
"* observeHealthKitSamplesFromOtherApps: \(observeHealthKitSamplesFromOtherApps)",
212+
"* observeHealthKitCarbSamplesFromOtherApps: \(observeHealthKitCarbSamplesFromOtherApps)",
213+
"* observeHealthKitDoseSamplesFromOtherApps: \(observeHealthKitDoseSamplesFromOtherApps)",
214+
"* observeHealthKitGlucoseSamplesFromOtherApps: \(observeHealthKitGlucoseSamplesFromOtherApps)",
176215
"* predictedGlucoseChartClampEnabled: \(predictedGlucoseChartClampEnabled)",
177216
"* remoteOverridesEnabled: \(remoteOverridesEnabled)",
178217
"* scenariosEnabled: \(scenariosEnabled)",
@@ -190,30 +229,26 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
190229

191230
extension FeatureFlagConfiguration {
192231
var allowDebugFeatures: Bool {
193-
if debugEnabled {
194-
return true
195-
}
196-
if UserDefaults.appGroup?.allowDebugFeatures ?? false {
197-
return true
198-
}
199232
#if ALLOW_DEBUG_FEATURES_ENABLED
200233
return true
201234
#else
202-
return false
235+
if UserDefaults.appGroup?.allowDebugFeatures ?? false {
236+
return true
237+
} else {
238+
return false
239+
}
203240
#endif
204241
}
205242

206243
var allowSimulators: Bool {
207-
if debugEnabled {
208-
return true
209-
}
210-
if UserDefaults.appGroup?.allowSimulators ?? false {
211-
return true
212-
}
213244
#if ALLOW_SIMULATORS_ENABLED
214245
return true
215246
#else
216-
return false
247+
if UserDefaults.appGroup?.allowSimulators ?? false {
248+
return true
249+
} else {
250+
return false
251+
}
217252
#endif
218253
}
219254
}

Common/Models/PumpManager.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ var availableStaticPumpManagers: [PumpManagerDescriptor] {
2626
}
2727

2828
extension PumpManager {
29-
var rawValue: [String: Any] {
29+
30+
typealias RawValue = [String: Any]
31+
32+
var rawValue: RawValue {
3033
return [
3134
"managerIdentifier": self.managerIdentifier,
3235
"state": self.rawState

Common/he.lproj/Intents.strings

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"80eo5o" = "Add Carb Entry";
2+
3+
"9KhaIS" = "I've set the preset";
4+
5+
"I4OZy8" = "Enable Override Preset";
6+
7+
"OcNxIj" = "Add Carb Entry";
8+
9+
"XNNmtH" = "Enable preset in Loop";
10+
11+
"ZZ3mtM" = "Enable an override preset in Loop";
12+
13+
"b085BW" = "I wasn't able to set the preset.";
14+
15+
"lYMuWV" = "Override Name";
16+
17+
"nDKAmn" = "What's the name of the override you'd like to set?";
18+
19+
"oLQSsJ" = "Enable '${overrideName}' Override Preset";
20+
21+
"yBzwCL" = "Override Selection";
22+
23+
"yc02Yq" = "Add a carb entry to Loop";
24+

0 commit comments

Comments
 (0)