Skip to content

Commit

Permalink
stable app
Browse files Browse the repository at this point in the history
  • Loading branch information
Ammaar-Alam committed Dec 9, 2024
1 parent 7af64c4 commit 89c4e40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct DoorActionIntent: AppIntent {
@Parameter(title: "Action", default: .open)
var action: DoorAction

func perform() async throws -> some IntentResult {
func perform() async throws -> some IntentResult & ProvidesDialog {
try await performDoorCommand(action.rawValue)
return .result(dialog: "Performed \(action) action on the door.")
}
Expand All @@ -47,7 +47,7 @@ struct OpenDoorIntent: AppIntent {
static var title: LocalizedStringResource = "Open Door"
static var description = IntentDescription("Opens the dorm door immediately.")

func perform() async throws -> some IntentResult {
func perform() async throws -> some IntentResult & ProvidesDialog {
try await performDoorCommand("open")
return .result(dialog: "Door opened successfully!")
}
Expand All @@ -58,7 +58,7 @@ struct OpenDoorIn3SecIntent: AppIntent {
static var title: LocalizedStringResource = "Open Door (3 Seconds)"
static var description = IntentDescription("Opens the door immediately, waits 3 seconds, then closes it.")

func perform() async throws -> some IntentResult {
func perform() async throws -> some IntentResult & ProvidesDialog {
try await performDoorCommand("open")
try await Task.sleep(nanoseconds: 3_000_000_000)
try await performDoorCommand("close")
Expand All @@ -71,7 +71,7 @@ struct CloseDoorIntent: AppIntent {
static var title: LocalizedStringResource = "Close Door"
static var description = IntentDescription("Closes the dorm door.")

func perform() async throws -> some IntentResult {
func perform() async throws -> some IntentResult & ProvidesDialog {
try await performDoorCommand("close")
return .result(dialog: "Door closed successfully!")
}
Expand Down

0 comments on commit 89c4e40

Please sign in to comment.