Skip to content

Commit b498923

Browse files
authored
Merge pull request #1305 from LoopKit/dev
Release 2.2
2 parents b04a8ab + c6c0839 commit b498923

File tree

67 files changed

+2633
-733
lines changed

Some content is hidden

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

67 files changed

+2633
-733
lines changed

Cartfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
github "LoopKit/LoopKit" ~> 3.0
2-
github "LoopKit/CGMBLEKit" ~> 3.2
1+
github "LoopKit/LoopKit" "dev"
2+
github "LoopKit/CGMBLEKit" "dev"
33
github "i-schuetz/SwiftCharts" == 0.6.5
4-
github "LoopKit/dexcom-share-client-swift" ~> 1.2
5-
github "LoopKit/G4ShareSpy" ~> 1.1
6-
github "ps2/rileylink_ios" ~> 3.0
4+
github "LoopKit/dexcom-share-client-swift" "dev"
5+
github "LoopKit/G4ShareSpy" "dev"
6+
github "ps2/rileylink_ios" "dev"
77
github "LoopKit/Amplitude-iOS" "decreepify"

Cartfile.resolved

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github "LoopKit/Amplitude-iOS" "2137d5fd44bf630ed33e1e72d7af6d8f8612f270"
2-
github "LoopKit/CGMBLEKit" "v3.2"
3-
github "LoopKit/G4ShareSpy" "v1.1"
4-
github "LoopKit/LoopKit" "v3.0"
2+
github "LoopKit/CGMBLEKit" "edcf503ef8fe260b69ca98eae508e679dfd9ad69"
3+
github "LoopKit/G4ShareSpy" "88c5a296e83ce618319ae365a7e6da76d9be126b"
4+
github "LoopKit/LoopKit" "6940ab10d258b21e0a33aa5729b1111a8d332d77"
55
github "LoopKit/MKRingProgressView" "f548a5c64832be2d37d7c91b5800e284887a2a0a"
6-
github "LoopKit/dexcom-share-client-swift" "v1.2"
6+
github "LoopKit/dexcom-share-client-swift" "c37d87fcf121c44721e87c9e6d2bea94e48728cc"
77
github "i-schuetz/SwiftCharts" "0.6.5"
8-
github "ps2/rileylink_ios" "v3.0"
8+
github "ps2/rileylink_ios" "c33115c038a7d133234cfa8b73c80603ff10a599"

Common/Models/WatchContext.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ final class WatchContext: RawRepresentable {
2121
var glucose: HKQuantity?
2222
var glucoseTrendRawValue: Int?
2323
var glucoseDate: Date?
24+
var glucoseSyncIdentifier: String?
2425

2526
var predictedGlucose: WatchPredictedGlucose?
2627
var eventualGlucose: HKQuantity? {
@@ -58,6 +59,7 @@ final class WatchContext: RawRepresentable {
5859

5960
glucoseTrendRawValue = rawValue["gt"] as? Int
6061
glucoseDate = rawValue["gd"] as? Date
62+
glucoseSyncIdentifier = rawValue["gs"] as? String
6163
iob = rawValue["iob"] as? Double
6264
reservoir = rawValue["r"] as? Double
6365
reservoirPercentage = rawValue["rp"] as? Double
@@ -95,6 +97,7 @@ final class WatchContext: RawRepresentable {
9597

9698
raw["gt"] = glucoseTrendRawValue
9799
raw["gd"] = glucoseDate
100+
raw["gs"] = glucoseSyncIdentifier
98101
raw["iob"] = iob
99102
raw["ld"] = loopLastRunDate
100103
raw["r"] = reservoir
@@ -117,3 +120,12 @@ extension WatchContext {
117120
}
118121
}
119122
}
123+
124+
extension WatchContext {
125+
var newGlucoseSample: NewGlucoseSample? {
126+
if let quantity = glucose, let date = glucoseDate, let syncIdentifier = glucoseSyncIdentifier {
127+
return NewGlucoseSample(date: date, quantity: quantity, isDisplayOnly: false, syncIdentifier: syncIdentifier, syncVersion: 0)
128+
}
129+
return nil
130+
}
131+
}

Common/sv.lproj/Intents.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"OcNxIj" = "Lägg till kolhydrater";
66

77
/* (No Comment) */
8-
"yc02Yq" = "Lägg till kolhydrater för att loopa";
8+
"yc02Yq" = "Lägg till kolhydrater för att kunna loopa";
99

Common/sv.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"Maximum" = "Maximum";
2121

2222
/* The short unit display string for milligrams of glucose per decilter */
23-
"mg/dL" = "mg/dL";
23+
"mg/dL" = "mg/dl";
2424

2525
/* Placeholder for lower range entry */
2626
"Minimum" = "Minimum";
2727

2828
/* The short unit display string for millimoles of glucose per liter */
29-
"mmol/L" = "mmol/L";
29+
"mmol/L" = "mmol/l";
3030

3131
/* Lesson title */
3232
"Modal Day" = "Genomsnittlig dag";

DoseMathTests/DoseMathTests.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class RecommendTempBasalTests: XCTestCase {
347347
lastTempBasal: nil
348348
)
349349

350-
XCTAssertEqual(1.425, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
350+
XCTAssertEqual(1.60, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
351351
XCTAssertEqual(TimeInterval(minutes: 30), dose!.duration)
352352
}
353353

@@ -365,7 +365,7 @@ class RecommendTempBasalTests: XCTestCase {
365365
lastTempBasal: nil
366366
)
367367

368-
XCTAssertEqual(1.475, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
368+
XCTAssertEqual(1.60, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
369369
XCTAssertEqual(TimeInterval(minutes: 30), dose!.duration)
370370
}
371371

@@ -588,7 +588,7 @@ class RecommendBolusTests: XCTestCase {
588588
volumeRounder: fortyIncrementsPerUnitRounder
589589
)
590590

591-
XCTAssertEqual(1.575, dose.amount)
591+
XCTAssertEqual(1.7, dose.amount)
592592

593593
if case BolusRecommendationNotice.currentGlucoseBelowTarget(let glucose) = dose.notice! {
594594
XCTAssertEqual(glucose.quantity.doubleValue(for: .milligramsPerDeciliter), 60)
@@ -657,7 +657,7 @@ class RecommendBolusTests: XCTestCase {
657657
volumeRounder: fortyIncrementsPerUnitRounder
658658
)
659659

660-
XCTAssertEqual(1.4, dose.amount)
660+
XCTAssertEqual(1.575, dose.amount)
661661
XCTAssertEqual(BolusRecommendationNotice.predictedGlucoseBelowTarget(minGlucose: glucose[1]), dose.notice!)
662662
}
663663

@@ -676,7 +676,7 @@ class RecommendBolusTests: XCTestCase {
676676
volumeRounder: fortyIncrementsPerUnitRounder
677677
)
678678

679-
XCTAssertEqual(0.575, dose.amount)
679+
XCTAssertEqual(0.7, dose.amount)
680680
}
681681

682682
func testStartVeryLowEndHigh() {
@@ -708,7 +708,7 @@ class RecommendBolusTests: XCTestCase {
708708
maxBolus: maxBolus
709709
)
710710

711-
XCTAssertEqual(1.575, dose.amount, accuracy: 1.0 / 40.0)
711+
XCTAssertEqual(1.7, dose.amount, accuracy: 1.0 / 40.0)
712712
}
713713

714714
func testHighAndFalling() {
@@ -724,7 +724,7 @@ class RecommendBolusTests: XCTestCase {
724724
maxBolus: maxBolus
725725
)
726726

727-
XCTAssertEqual(0.325, dose.amount, accuracy: 1.0 / 40.0)
727+
XCTAssertEqual(0.4, dose.amount, accuracy: 1.0 / 40.0)
728728
}
729729

730730
func testInRangeAndRising() {
@@ -740,7 +740,7 @@ class RecommendBolusTests: XCTestCase {
740740
maxBolus: maxBolus
741741
)
742742

743-
XCTAssertEqual(0.325, dose.amount, accuracy: 1.0 / 40.0)
743+
XCTAssertEqual(0.4, dose.amount, accuracy: 1.0 / 40.0)
744744

745745
// Less existing temp
746746

@@ -771,7 +771,7 @@ class RecommendBolusTests: XCTestCase {
771771
volumeRounder: fortyIncrementsPerUnitRounder
772772
)
773773

774-
XCTAssertEqual(0.275, dose.amount)
774+
XCTAssertEqual(0.375, dose.amount)
775775
}
776776

777777
func testHighAndRising() {
@@ -787,7 +787,7 @@ class RecommendBolusTests: XCTestCase {
787787
maxBolus: maxBolus
788788
)
789789

790-
XCTAssertEqual(1.25, dose.amount)
790+
XCTAssertEqual(1.35, dose.amount, accuracy: 1.0 / 40.0)
791791

792792
// Use mmol sensitivity value
793793
let insulinSensitivitySchedule = InsulinSensitivitySchedule(unit: HKUnit.millimolesPerLiter, dailyItems: [RepeatingScheduleValue(startTime: 0.0, value: 10.0 / 3)])!
@@ -802,7 +802,7 @@ class RecommendBolusTests: XCTestCase {
802802
maxBolus: maxBolus
803803
)
804804

805-
XCTAssertEqual(1.25, dose.amount, accuracy: 1.0 / 40.0)
805+
XCTAssertEqual(1.35, dose.amount, accuracy: 1.0 / 40.0)
806806
}
807807

808808
func testRiseAfterDIA() {

DoseMathTests/sv.lproj/Localizable.strings

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Message when offering bolus recommendation even though bg is below range. (1: glucose value) */
2-
"Current glucose of %1$@ is below correction range." = "Current glucose of %1$@ is below correction range.";
2+
"Current glucose of %1$@ is below correction range." = "Nuvarande glukosvärde %1$@ är under målvärdet.";
33

44
/* The short unit display string for decibles */
55
"dB" = "dB";
@@ -8,16 +8,16 @@
88
"g" = "g";
99

1010
/* The short unit display string for milligrams of glucose per decilter */
11-
"mg/dL" = "mg/dL";
11+
"mg/dL" = "mg/dl";
1212

1313
/* The short unit display string for millimoles of glucose per liter */
14-
"mmol/L" = "mmol/L";
14+
"mmol/L" = "mmol/l";
1515

1616
/* Message when offering bolus recommendation even though bg is below range and minBG is in future. (1: glucose time)(2: glucose number) */
17-
"Predicted glucose at %1$@ is %2$@." = "Predicted glucose at %1$@ is %2$@.";
17+
"Predicted glucose at %1$@ is %2$@." = "Förväntat glukosvärde vid %1$@ är %2$@.";
1818

1919
/* Notice message when recommending bolus when BG is below the suspend threshold. (1: glucose value) */
20-
"Predicted glucose of %1$@ is below your suspend threshold setting." = "Predicted glucose of %1$@ is below your suspend threshold setting.";
20+
"Predicted glucose of %1$@ is below your suspend threshold setting." = "Det förväntade slutglukosvärdet %1$@ är under ditt angivna tröskelvärde.";
2121

2222
/* Format string for combining localized numeric value and unit. (1: numeric value)(2: unit) */
2323
"QUANTITY_VALUE_AND_UNIT" = "%1$@ %2$@";

Learn/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>NSHealthShareUsageDescription</key>
28-
<string>Meal data from the Health database is used to determine glucose effects. Glucose data from the Health database is used for graphing and momentum calculation.</string>
28+
<string>Meal data from the Health database is used to determine glucose effects. Glucose data from the Health database is used for graphing and momentum calculation. Sleep data from the Health database is used to optimize delivery of Apple Watch complication updates during the time you are awake.</string>
2929
<key>UILaunchStoryboardName</key>
3030
<string>LaunchScreen</string>
3131
<key>UIMainStoryboardFile</key>

Learn/fi.lproj/InfoPlist.strings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* Privacy - Health Share Usage Description */
2+
"NSHealthShareUsageDescription" = "Terveys-sovelluksen ateriatietoja käytetään glukoosivaikutusten määrittämiseen. Terveys-sovelluksen glukoositietoja käytetään graafeissa ja laskelmissa.";
3+

Learn/sv.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"Time in Range" = "Tid inom målvärde";
2727

2828
/* Lesson subtitle */
29-
"Visualizes the most frequent glucose values by time of day" = "Visar de vanligaste glukosvärdena under olika tider på dagen";
29+
"Visualizes the most frequent glucose values by time of day" = "Visar de vanligaste glukosvärdena under olika tider på dygnet";
3030

3131
/* Unit string for a count of calendar weeks */
3232
"Weeks" = "Veckor";

0 commit comments

Comments
 (0)