Skip to content

Commit

Permalink
Merge pull request #1305 from LoopKit/dev
Browse files Browse the repository at this point in the history
Release 2.2
  • Loading branch information
ps2 authored Apr 18, 2020
2 parents b04a8ab + c6c0839 commit b498923
Show file tree
Hide file tree
Showing 67 changed files with 2,633 additions and 733 deletions.
10 changes: 5 additions & 5 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github "LoopKit/LoopKit" ~> 3.0
github "LoopKit/CGMBLEKit" ~> 3.2
github "LoopKit/LoopKit" "dev"
github "LoopKit/CGMBLEKit" "dev"
github "i-schuetz/SwiftCharts" == 0.6.5
github "LoopKit/dexcom-share-client-swift" ~> 1.2
github "LoopKit/G4ShareSpy" ~> 1.1
github "ps2/rileylink_ios" ~> 3.0
github "LoopKit/dexcom-share-client-swift" "dev"
github "LoopKit/G4ShareSpy" "dev"
github "ps2/rileylink_ios" "dev"
github "LoopKit/Amplitude-iOS" "decreepify"
10 changes: 5 additions & 5 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github "LoopKit/Amplitude-iOS" "2137d5fd44bf630ed33e1e72d7af6d8f8612f270"
github "LoopKit/CGMBLEKit" "v3.2"
github "LoopKit/G4ShareSpy" "v1.1"
github "LoopKit/LoopKit" "v3.0"
github "LoopKit/CGMBLEKit" "edcf503ef8fe260b69ca98eae508e679dfd9ad69"
github "LoopKit/G4ShareSpy" "88c5a296e83ce618319ae365a7e6da76d9be126b"
github "LoopKit/LoopKit" "6940ab10d258b21e0a33aa5729b1111a8d332d77"
github "LoopKit/MKRingProgressView" "f548a5c64832be2d37d7c91b5800e284887a2a0a"
github "LoopKit/dexcom-share-client-swift" "v1.2"
github "LoopKit/dexcom-share-client-swift" "c37d87fcf121c44721e87c9e6d2bea94e48728cc"
github "i-schuetz/SwiftCharts" "0.6.5"
github "ps2/rileylink_ios" "v3.0"
github "ps2/rileylink_ios" "c33115c038a7d133234cfa8b73c80603ff10a599"
12 changes: 12 additions & 0 deletions Common/Models/WatchContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ final class WatchContext: RawRepresentable {
var glucose: HKQuantity?
var glucoseTrendRawValue: Int?
var glucoseDate: Date?
var glucoseSyncIdentifier: String?

var predictedGlucose: WatchPredictedGlucose?
var eventualGlucose: HKQuantity? {
Expand Down Expand Up @@ -58,6 +59,7 @@ final class WatchContext: RawRepresentable {

glucoseTrendRawValue = rawValue["gt"] as? Int
glucoseDate = rawValue["gd"] as? Date
glucoseSyncIdentifier = rawValue["gs"] as? String
iob = rawValue["iob"] as? Double
reservoir = rawValue["r"] as? Double
reservoirPercentage = rawValue["rp"] as? Double
Expand Down Expand Up @@ -95,6 +97,7 @@ final class WatchContext: RawRepresentable {

raw["gt"] = glucoseTrendRawValue
raw["gd"] = glucoseDate
raw["gs"] = glucoseSyncIdentifier
raw["iob"] = iob
raw["ld"] = loopLastRunDate
raw["r"] = reservoir
Expand All @@ -117,3 +120,12 @@ extension WatchContext {
}
}
}

extension WatchContext {
var newGlucoseSample: NewGlucoseSample? {
if let quantity = glucose, let date = glucoseDate, let syncIdentifier = glucoseSyncIdentifier {
return NewGlucoseSample(date: date, quantity: quantity, isDisplayOnly: false, syncIdentifier: syncIdentifier, syncVersion: 0)
}
return nil
}
}
2 changes: 1 addition & 1 deletion Common/sv.lproj/Intents.strings
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"OcNxIj" = "Lägg till kolhydrater";

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

4 changes: 2 additions & 2 deletions Common/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"Maximum" = "Maximum";

/* The short unit display string for milligrams of glucose per decilter */
"mg/dL" = "mg/dL";
"mg/dL" = "mg/dl";

/* Placeholder for lower range entry */
"Minimum" = "Minimum";

/* The short unit display string for millimoles of glucose per liter */
"mmol/L" = "mmol/L";
"mmol/L" = "mmol/l";

/* Lesson title */
"Modal Day" = "Genomsnittlig dag";
Expand Down
22 changes: 11 additions & 11 deletions DoseMathTests/DoseMathTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class RecommendTempBasalTests: XCTestCase {
lastTempBasal: nil
)

XCTAssertEqual(1.425, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
XCTAssertEqual(1.60, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
XCTAssertEqual(TimeInterval(minutes: 30), dose!.duration)
}

Expand All @@ -365,7 +365,7 @@ class RecommendTempBasalTests: XCTestCase {
lastTempBasal: nil
)

XCTAssertEqual(1.475, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
XCTAssertEqual(1.60, dose!.unitsPerHour, accuracy: 1.0 / 40.0)
XCTAssertEqual(TimeInterval(minutes: 30), dose!.duration)
}

Expand Down Expand Up @@ -588,7 +588,7 @@ class RecommendBolusTests: XCTestCase {
volumeRounder: fortyIncrementsPerUnitRounder
)

XCTAssertEqual(1.575, dose.amount)
XCTAssertEqual(1.7, dose.amount)

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

XCTAssertEqual(1.4, dose.amount)
XCTAssertEqual(1.575, dose.amount)
XCTAssertEqual(BolusRecommendationNotice.predictedGlucoseBelowTarget(minGlucose: glucose[1]), dose.notice!)
}

Expand All @@ -676,7 +676,7 @@ class RecommendBolusTests: XCTestCase {
volumeRounder: fortyIncrementsPerUnitRounder
)

XCTAssertEqual(0.575, dose.amount)
XCTAssertEqual(0.7, dose.amount)
}

func testStartVeryLowEndHigh() {
Expand Down Expand Up @@ -708,7 +708,7 @@ class RecommendBolusTests: XCTestCase {
maxBolus: maxBolus
)

XCTAssertEqual(1.575, dose.amount, accuracy: 1.0 / 40.0)
XCTAssertEqual(1.7, dose.amount, accuracy: 1.0 / 40.0)
}

func testHighAndFalling() {
Expand All @@ -724,7 +724,7 @@ class RecommendBolusTests: XCTestCase {
maxBolus: maxBolus
)

XCTAssertEqual(0.325, dose.amount, accuracy: 1.0 / 40.0)
XCTAssertEqual(0.4, dose.amount, accuracy: 1.0 / 40.0)
}

func testInRangeAndRising() {
Expand All @@ -740,7 +740,7 @@ class RecommendBolusTests: XCTestCase {
maxBolus: maxBolus
)

XCTAssertEqual(0.325, dose.amount, accuracy: 1.0 / 40.0)
XCTAssertEqual(0.4, dose.amount, accuracy: 1.0 / 40.0)

// Less existing temp

Expand Down Expand Up @@ -771,7 +771,7 @@ class RecommendBolusTests: XCTestCase {
volumeRounder: fortyIncrementsPerUnitRounder
)

XCTAssertEqual(0.275, dose.amount)
XCTAssertEqual(0.375, dose.amount)
}

func testHighAndRising() {
Expand All @@ -787,7 +787,7 @@ class RecommendBolusTests: XCTestCase {
maxBolus: maxBolus
)

XCTAssertEqual(1.25, dose.amount)
XCTAssertEqual(1.35, dose.amount, accuracy: 1.0 / 40.0)

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

XCTAssertEqual(1.25, dose.amount, accuracy: 1.0 / 40.0)
XCTAssertEqual(1.35, dose.amount, accuracy: 1.0 / 40.0)
}

func testRiseAfterDIA() {
Expand Down
10 changes: 5 additions & 5 deletions DoseMathTests/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Message when offering bolus recommendation even though bg is below range. (1: glucose value) */
"Current glucose of %1$@ is below correction range." = "Current glucose of %1$@ is below correction range.";
"Current glucose of %1$@ is below correction range." = "Nuvarande glukosvärde %1$@ är under målvärdet.";

/* The short unit display string for decibles */
"dB" = "dB";
Expand All @@ -8,16 +8,16 @@
"g" = "g";

/* The short unit display string for milligrams of glucose per decilter */
"mg/dL" = "mg/dL";
"mg/dL" = "mg/dl";

/* The short unit display string for millimoles of glucose per liter */
"mmol/L" = "mmol/L";
"mmol/L" = "mmol/l";

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

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

/* Format string for combining localized numeric value and unit. (1: numeric value)(2: unit) */
"QUANTITY_VALUE_AND_UNIT" = "%1$@ %2$@";
Expand Down
2 changes: 1 addition & 1 deletion Learn/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSHealthShareUsageDescription</key>
<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>
<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>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
3 changes: 3 additions & 0 deletions Learn/fi.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* Privacy - Health Share Usage Description */
"NSHealthShareUsageDescription" = "Terveys-sovelluksen ateriatietoja käytetään glukoosivaikutusten määrittämiseen. Terveys-sovelluksen glukoositietoja käytetään graafeissa ja laskelmissa.";

2 changes: 1 addition & 1 deletion Learn/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Time in Range" = "Tid inom målvärde";

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

/* Unit string for a count of calendar weeks */
"Weeks" = "Veckor";
Expand Down
2 changes: 1 addition & 1 deletion Learn/sv.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* Class = "UINavigationItem"; title = "Learn"; ObjectID = "8hF-Ij-B7m"; */
"8hF-Ij-B7m.title" = "Learn";
"8hF-Ij-B7m.title" = "Utbildning";

3 changes: 2 additions & 1 deletion Loop Status Extension/StatusViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ class StatusViewController: UIViewController, NCWidgetProviding {
return
}

if let lastGlucose = glucose.last {
if let lastGlucose = glucose.last, let recencyInterval = defaults.loopSettings?.inputDataRecencyInterval {
self.hudView.glucoseHUD.setGlucoseQuantity(
lastGlucose.quantity.doubleValue(for: unit),
at: lastGlucose.startDate,
unit: unit,
staleGlucoseAge: recencyInterval,
sensor: context.sensor
)
}
Expand Down
2 changes: 1 addition & 1 deletion Loop Status Extension/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* The subtitle format describing eventual glucose. (1: localized glucose value description) */
"Eventually %1$@" = "Eventuellt %1$@";
"Eventually %1$@" = "Förväntat %1$@";

/* The subtitle format describing units of active insulin. (1: localized insulin value description) */
"IOB %1$@ U" = "IOB %1$@ E";
Expand Down
2 changes: 1 addition & 1 deletion Loop Status Extension/sv.lproj/MainInterface.strings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Class = "UILabel"; text = "Eventually 92 mg/dL"; ObjectID = "9iF-xY-Bh4"; */
"9iF-xY-Bh4.text" = "Eventuellt 92 mg/dL";
"9iF-xY-Bh4.text" = "Förväntat 5,1 mmol/l";

/* Class = "UILabel"; text = "IOB 1.0 U"; ObjectID = "UPi-dG-yYD"; */
"UPi-dG-yYD.text" = "IOB 1.0 E";
Expand Down
2 changes: 1 addition & 1 deletion Loop.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
MAIN_APP_BUNDLE_IDENTIFIER = com.${DEVELOPMENT_TEAM}.loopkit
MAIN_APP_DISPLAY_NAME = Loop

LOOP_MARKETING_VERSION = 2.0
LOOP_MARKETING_VERSION = 2.2.0

APPICON_NAME = AppIcon

Expand Down
Loading

0 comments on commit b498923

Please sign in to comment.