Skip to content

Commit e71e7ae

Browse files
authored
Merge pull request #585 from tidepool-org/ps2/LOOP-4688/diy-sync
LOOP-4688 DIY Sync
2 parents 79b648b + 480ad6f commit e71e7ae

File tree

194 files changed

+1877
-6956
lines changed

Some content is hidden

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

194 files changed

+1877
-6956
lines changed

.github/workflows/inactive_issues.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close inactive issues
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
6+
jobs:
7+
close-issues:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
steps:
13+
- uses: actions/stale@v5
14+
with:
15+
operations-per-run: 100
16+
days-before-issue-stale: 30
17+
days-before-issue-close: 14
18+
stale-issue-label: "stale"
19+
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
20+
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
21+
days-before-pr-stale: -1
22+
days-before-pr-close: -1
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}

Common/Extensions/GlucoseRangeSchedule.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ extension GlucoseRangeSchedule {
1313
func minQuantity(at date: Date) -> HKQuantity {
1414
return HKQuantity(unit: unit, doubleValue: value(at: date).minValue)
1515
}
16-
}
17-
18-
19-
extension ClosedRange where Bound == HKQuantity {
20-
func averageValue(for unit: HKUnit) -> Double {
21-
let minValue = lowerBound.doubleValue(for: unit)
22-
let maxValue = upperBound.doubleValue(for: unit)
23-
return (maxValue + minValue) / 2
16+
func maxQuantity(at date: Date) -> HKQuantity {
17+
return HKQuantity(unit: unit, doubleValue: value(at: date).maxValue)
2418
}
2519
}

Common/FeatureFlags.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ struct FeatureFlagConfiguration: Decodable {
3535
let siriEnabled: Bool
3636
let simpleBolusCalculatorEnabled: Bool
3737
let usePositiveMomentumAndRCForManualBoluses: Bool
38-
let dynamicCarbAbsorptionEnabled: Bool
3938
let adultChildInsulinModelSelectionEnabled: Bool
4039
let profileExpirationSettingsViewEnabled: Bool
4140
let missedMealNotifications: Bool
41+
let allowAlgorithmExperiments: Bool
4242

4343

4444
fileprivate init() {
@@ -213,8 +213,6 @@ struct FeatureFlagConfiguration: Decodable {
213213
self.adultChildInsulinModelSelectionEnabled = false
214214
#endif
215215

216-
self.dynamicCarbAbsorptionEnabled = true
217-
218216
// ProfileExpirationSettingsView is inverse, since the default state is enabled.
219217
#if PROFILE_EXPIRATION_SETTINGS_VIEW_DISABLED
220218
self.profileExpirationSettingsViewEnabled = false
@@ -229,6 +227,11 @@ struct FeatureFlagConfiguration: Decodable {
229227
self.missedMealNotifications = true
230228
#endif
231229

230+
#if ALLOW_ALGORITHM_EXPERIMENTS
231+
self.allowAlgorithmExperiments = true
232+
#else
233+
self.allowAlgorithmExperiments = false
234+
#endif
232235
}
233236
}
234237

@@ -260,10 +263,10 @@ extension FeatureFlagConfiguration : CustomDebugStringConvertible {
260263
"* allowDebugFeatures: \(allowDebugFeatures)",
261264
"* simpleBolusCalculatorEnabled: \(simpleBolusCalculatorEnabled)",
262265
"* usePositiveMomentumAndRCForManualBoluses: \(usePositiveMomentumAndRCForManualBoluses)",
263-
"* dynamicCarbAbsorptionEnabled: \(dynamicCarbAbsorptionEnabled)",
264266
"* adultChildInsulinModelSelectionEnabled: \(adultChildInsulinModelSelectionEnabled)",
265267
"* profileExpirationSettingsViewEnabled: \(profileExpirationSettingsViewEnabled)",
266-
"* missedMealNotifications: \(missedMealNotifications)"
268+
"* missedMealNotifications: \(missedMealNotifications)",
269+
"* allowAlgorithmExperiments: \(allowAlgorithmExperiments)"
267270
].joined(separator: "\n")
268271
}
269272
}

Common/Models/StatusExtensionContext.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ struct StatusExtensionContext: RawRepresentable {
297297
var lastLoopCompleted: Date?
298298
var createdAt: Date?
299299
var isClosedLoop: Bool?
300+
var preMealPresetAllowed: Bool?
301+
var preMealPresetActive: Bool?
302+
var customPresetActive: Bool?
300303
var netBasal: NetBasalContext?
301304
var batteryPercentage: Double?
302305
var reservoirCapacity: Double?
@@ -326,6 +329,9 @@ struct StatusExtensionContext: RawRepresentable {
326329
lastLoopCompleted = rawValue["lastLoopCompleted"] as? Date
327330
createdAt = rawValue["createdAt"] as? Date
328331
isClosedLoop = rawValue["isClosedLoop"] as? Bool
332+
preMealPresetAllowed = rawValue["preMealPresetAllowed"] as? Bool
333+
preMealPresetActive = rawValue["preMealPresetActive"] as? Bool
334+
customPresetActive = rawValue["customPresetActive"] as? Bool
329335
batteryPercentage = rawValue["batteryPercentage"] as? Double
330336
reservoirCapacity = rawValue["reservoirCapacity"] as? Double
331337
carbsOnBoard = rawValue["carbsOnBoard"] as? Double
@@ -364,6 +370,9 @@ struct StatusExtensionContext: RawRepresentable {
364370
raw["lastLoopCompleted"] = lastLoopCompleted
365371
raw["createdAt"] = createdAt
366372
raw["isClosedLoop"] = isClosedLoop
373+
raw["preMealPresetAllowed"] = preMealPresetAllowed
374+
raw["preMealPresetActive"] = preMealPresetActive
375+
raw["customPresetActive"] = customPresetActive
367376
raw["netBasal"] = netBasal?.rawValue
368377
raw["batteryPercentage"] = batteryPercentage
369378
raw["reservoirCapacity"] = reservoirCapacity

Common/de.lproj/Intents.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"9KhaIS" = "Voreinstellung gesetzt";
33

44
/* (No Comment) */
5-
"80eo5o" = "Kohlenhydrate hinzufügen";
5+
"80eo5o" = "KH-Eintrag hinzufügen";
66

77
/* (No Comment) */
88
"b085BW" = "Voreinstellung konnte nicht gesetzt werden.";
99

1010
/* (No Comment) */
11-
"I4OZy8" = "Enable Override Preset";
11+
"I4OZy8" = "Aktiviere Voreinstellung";
1212

1313
/* (No Comment) */
1414
"lYMuWV" = "Voreinstellungs-Name";
@@ -17,7 +17,7 @@
1717
"nDKAmn" = "Welche Voreinstellung möchten Sie aktivieren?";
1818

1919
/* (No Comment) */
20-
"OcNxIj" = "Kohlenhydrate hinzufügen";
20+
"OcNxIj" = "KH hinzufügen";
2121

2222
/* (No Comment) */
2323
"oLQSsJ" = "Aktiviere '${overrideName}' Voreinstellung";

Common/pl.lproj/Intents.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* (No Comment) */
2-
"9KhaIS" = "Ustawiłem Cel Tymczas.";
2+
"9KhaIS" = "Ustawiłem Cel Tymczasowy";
33

44
/* (No Comment) */
55
"80eo5o" = "Wprowadź węglowodany";

DoseMathTests/Base.lproj/Localizable.strings

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

0 commit comments

Comments
 (0)