|
@@ -8,7 +8,7 @@ import Swinject
|
|
|
static var title: LocalizedStringResource = "Add carbs"
|
|
static var title: LocalizedStringResource = "Add carbs"
|
|
|
|
|
|
|
|
// Description of the action in the Shortcuts app
|
|
// Description of the action in the Shortcuts app
|
|
|
- static var description = IntentDescription("Allow to add carbs in iAPS.")
|
|
|
|
|
|
|
+ static var description = IntentDescription("Allow to add carbs in Trio.")
|
|
|
|
|
|
|
|
internal var carbRequest: CarbPresetIntentRequest
|
|
internal var carbRequest: CarbPresetIntentRequest
|
|
|
|
|
|
|
@@ -45,6 +45,11 @@ import Swinject
|
|
|
) var dateAdded: Date
|
|
) var dateAdded: Date
|
|
|
|
|
|
|
|
@Parameter(
|
|
@Parameter(
|
|
|
|
|
+ title: "Notering",
|
|
|
|
|
+ description: "Emoji or short text"
|
|
|
|
|
+ ) var note: String?
|
|
|
|
|
+
|
|
|
|
|
+ @Parameter(
|
|
|
title: "Confirm Before applying",
|
|
title: "Confirm Before applying",
|
|
|
description: "If toggled, you will need to confirm before applying",
|
|
description: "If toggled, you will need to confirm before applying",
|
|
|
default: true
|
|
default: true
|
|
@@ -55,12 +60,14 @@ import Swinject
|
|
|
Summary("Applying \(\.$carbQuantity) at \(\.$dateAdded)") {
|
|
Summary("Applying \(\.$carbQuantity) at \(\.$dateAdded)") {
|
|
|
\.$fatQuantity
|
|
\.$fatQuantity
|
|
|
\.$proteinQuantity
|
|
\.$proteinQuantity
|
|
|
|
|
+ \.$note
|
|
|
\.$confirmBeforeApplying
|
|
\.$confirmBeforeApplying
|
|
|
}
|
|
}
|
|
|
}, otherwise: {
|
|
}, otherwise: {
|
|
|
Summary("Immediately applying \(\.$carbQuantity) at \(\.$dateAdded)") {
|
|
Summary("Immediately applying \(\.$carbQuantity) at \(\.$dateAdded)") {
|
|
|
\.$fatQuantity
|
|
\.$fatQuantity
|
|
|
\.$proteinQuantity
|
|
\.$proteinQuantity
|
|
|
|
|
+ \.$note
|
|
|
\.$confirmBeforeApplying
|
|
\.$confirmBeforeApplying
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -82,7 +89,13 @@ import Swinject
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let finalQuantityCarbsDisplay = try await carbRequest.addCarbs(quantityCarbs, fatQuantity, proteinQuantity, dateAdded)
|
|
|
|
|
|
|
+ let finalQuantityCarbsDisplay = try await carbRequest.addCarbs(
|
|
|
|
|
+ quantityCarbs,
|
|
|
|
|
+ fatQuantity,
|
|
|
|
|
+ proteinQuantity,
|
|
|
|
|
+ dateAdded,
|
|
|
|
|
+ note
|
|
|
|
|
+ )
|
|
|
return .result(
|
|
return .result(
|
|
|
dialog: IntentDialog(stringLiteral: finalQuantityCarbsDisplay)
|
|
dialog: IntentDialog(stringLiteral: finalQuantityCarbsDisplay)
|
|
|
)
|
|
)
|