Clean up labels and siri phrases

This commit is contained in:
Garth Vander Houwen 2024-08-27 21:17:35 -07:00
parent 3df98d4345
commit eec7f593c5
6 changed files with 27 additions and 33 deletions

View file

@ -7225,9 +7225,6 @@
},
"Factory Reset" : {
},
"Factory Reset Node" : {
},
"Factory reset your device and app? " : {
@ -8167,6 +8164,9 @@
}
}
}
},
"Group Message" : {
},
"Gusts %@" : {
@ -14582,9 +14582,6 @@
},
"Message" : {
},
"Message Channel" : {
},
"Message content exceeds 228 bytes." : {
@ -17428,7 +17425,7 @@
"Reset NodeDB" : {
},
"Restart Node" : {
"Restart" : {
},
"Restart to the node you are connected to" : {
@ -19175,7 +19172,7 @@
"Send" : {
},
"Send a Channel Message" : {
"Send a Group Message" : {
},
"Send a message to a certain meshtastic channel" : {
@ -19924,7 +19921,7 @@
"Show Weather" : {
},
"Shut Down Node" : {
"Shut Down" : {
},
"Shut Down Node?" : {

View file

@ -9,7 +9,7 @@ import Foundation
import AppIntents
struct FactoryResetNodeIntent: AppIntent {
static var title: LocalizedStringResource = "Factory Reset Node"
static var title: LocalizedStringResource = "Factory Reset"
static var description: IntentDescription = "Perform a factory reset on the node you are connected to"
func perform() async throws -> some IntentResult {

View file

@ -9,7 +9,7 @@ import Foundation
import AppIntents
struct MessageChannelIntent: AppIntent {
static var title: LocalizedStringResource = "Send a Channel Message"
static var title: LocalizedStringResource = "Send a Group Message"
static var description: IntentDescription = "Send a message to a certain meshtastic channel"

View file

@ -9,13 +9,12 @@ import Foundation
import AppIntents
struct RestartNodeIntent: AppIntent {
static var title: LocalizedStringResource = "Restart Node"
static var title: LocalizedStringResource = "Restart"
static var description: IntentDescription = "Restart to the node you are connected to"
func perform() async throws -> some IntentResult {
try await requestConfirmation(result: .result(dialog: "Reboot Node?"))
if !BLEManager.shared.isConnected {
@ -27,7 +26,7 @@ struct RestartNodeIntent: AppIntent {
let fromUser = connectedNode.user,
let toUser = connectedNode.user,
let adminIndex = connectedNode.myInfo?.adminIndex {
// Attempt to send shutdown, throw an error if it fails
if !BLEManager.shared.sendReboot(fromUser: fromUser, toUser: toUser, adminIndex: adminIndex) {
throw AppIntentErrors.AppIntentError.message("Failed to restart")
@ -35,8 +34,6 @@ struct RestartNodeIntent: AppIntent {
} else {
throw AppIntentErrors.AppIntentError.message("Failed to retrieve connected node or required data")
}
return .result()
}
}

View file

@ -11,24 +11,26 @@ import AppIntents
struct ShortcutsProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(intent: ShutDownNodeIntent(),
phrases: ["Shut down node in \(.applicationName)",
"Turn off node in \(.applicationName)",
"Power down node in \(.applicationName)",
"Deactivate node in \(.applicationName)"],
shortTitle: "Shut Down Node",
phrases: ["Shut down \(.applicationName) node",
"Shut down my \(.applicationName) node",
"Turn off \(.applicationName) node",
"Power down \(.applicationName) node",
"Deactivate \(.applicationName) node"],
shortTitle: "Shut Down",
systemImageName: "power")
AppShortcut(intent: RestartNodeIntent(),
phrases: ["Restart node in \(.applicationName)",
"Reboot node in \(.applicationName)",
"Reset node in \(.applicationName)",
"Start node again in \(.applicationName)"],
shortTitle: "Restart Node",
phrases: ["Restart \(.applicationName) node",
"Restart my \(.applicationName) node",
"Reboot \(.applicationName) node",
"Reboot my \(.applicationName) node"],
shortTitle: "Restart",
systemImageName: "arrow.circlepath")
AppShortcut(intent: MessageChannelIntent(),
phrases: ["Message channel in \(.applicationName)"],
shortTitle: "Message Channel",
phrases: ["Message a \(.applicationName) channel",
"Send a \(.applicationName) group message"],
shortTitle: "Group Message",
systemImageName: "message")
}
}

View file

@ -9,10 +9,9 @@ import Foundation
import AppIntents
struct ShutDownNodeIntent: AppIntent {
static var title: LocalizedStringResource = "Shut Down Node"
static var title: LocalizedStringResource = "Shut Down"
static var description: IntentDescription = "Send a shutdown to the node you are connected to"
func perform() async throws -> some IntentResult {
try await requestConfirmation(result: .result(dialog: "Shut Down Node?"))
@ -27,7 +26,7 @@ struct ShutDownNodeIntent: AppIntent {
let fromUser = connectedNode.user,
let toUser = connectedNode.user,
let adminIndex = connectedNode.myInfo?.adminIndex {
// Attempt to send shutdown, throw an error if it fails
if !BLEManager.shared.sendShutdown(fromUser: fromUser, toUser: toUser, adminIndex: adminIndex) {
throw AppIntentErrors.AppIntentError.message("Failed to shut down")
@ -35,7 +34,6 @@ struct ShutDownNodeIntent: AppIntent {
} else {
throw AppIntentErrors.AppIntentError.message("Failed to retrieve connected node or required data")
}
return .result()
}
}