Skip to content

Commit e400586

Browse files
malysclaude
andcommitted
feat: add SPEAK_TEXT local action (TTS)
Firmware-independent, no bridge action — same shape as LAUNCH_APP and SHOW_NOTIFICATION. Strings added in all 6 locales; matrix regenerated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent b880ef0 commit e400586

10 files changed

Lines changed: 21 additions & 3 deletions

File tree

‎docs/firmware-matrix.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
|---|:--:|:--:|:--:|:--:|:--:|:--:|
4747
| LAUNCH_APP | — | — | — | — | — | — |
4848
| SHOW_NOTIFICATION | — | — | — | — | — | — |
49+
| SPEAK_TEXT | — | — | — | — | — | — |
4950
| APPLY_PROFILE | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
5051
| SET_DRIVE_MODE | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
5152
| SET_REGEN_LEVEL | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |

‎lib/src/main/java/com/mg4/hardware/catalog/ActionType.kt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ enum class ActionType(
235235
SHOW_NOTIFICATION(
236236
R.string.act_notify, ActionGroup.SYSTEM,
237237
ValueSpec(ValueKind.TEXT), bridgeAction = null
238+
),
239+
/**
240+
* Speaks the text through the platform TTS engine. Local like the two above: nothing
241+
* is written to the vehicle, so no firmware annotation and no bridge action.
242+
*/
243+
SPEAK_TEXT(
244+
R.string.act_speak, ActionGroup.SYSTEM,
245+
ValueSpec(ValueKind.TEXT), bridgeAction = null
238246
);
239247

240248
companion object {

‎lib/src/main/res/values-de/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Spurverlassen Lenkradvibration</string>
110110
<string name="act_launch_app">App starten</string>
111111
<string name="act_notify">Benachrichtigung anzeigen</string>
112+
<string name="act_speak">Nachricht vorlesen</string>
112113
</resources>

‎lib/src/main/res/values-es/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Vibración del volante por cambio de carril</string>
110110
<string name="act_launch_app">Abrir una app</string>
111111
<string name="act_notify">Mostrar una notificación</string>
112+
<string name="act_speak">Decir un mensaje</string>
112113
</resources>

‎lib/src/main/res/values-fr/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Vibration volant en sortie de voie</string>
110110
<string name="act_launch_app">Lancer une application</string>
111111
<string name="act_notify">Afficher une notification</string>
112+
<string name="act_speak">Dire un message</string>
112113
</resources>

‎lib/src/main/res/values-it/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Vibrazione volante cambio corsia</string>
110110
<string name="act_launch_app">Avvia un\'app</string>
111111
<string name="act_notify">Mostra una notifica</string>
112+
<string name="act_speak">Pronuncia un messaggio</string>
112113
</resources>

‎lib/src/main/res/values-pt/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Vibração do volante por saída de faixa</string>
110110
<string name="act_launch_app">Abrir uma app</string>
111111
<string name="act_notify">Mostrar uma notificação</string>
112+
<string name="act_speak">Dizer uma mensagem</string>
112113
</resources>

‎lib/src/main/res/values/strings.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@
109109
<string name="act_las_vibration">Lane departure steering vibration</string>
110110
<string name="act_launch_app">Launch an app</string>
111111
<string name="act_notify">Show a notification</string>
112+
<string name="act_speak">Speak a message</string>
112113
</resources>

‎lib/src/test/java/com/mg4/hardware/FirmwareSupportTest.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class FirmwareSupportTest {
2828
)
2929
private val firmwareIndependentActions = setOf(
3030
ActionType.LAUNCH_APP,
31-
ActionType.SHOW_NOTIFICATION
31+
ActionType.SHOW_NOTIFICATION,
32+
ActionType.SPEAK_TEXT
3233
)
3334

3435
@Test

‎lib/src/test/java/com/mg4/hardware/catalog/CatalogConsistencyTest.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ class CatalogConsistencyTest {
1919
fun `toute action vehicule cible une action du pont`() {
2020
// bridgeAction=null est réservé aux actions locales (lancer une app, notifier).
2121
// Une action véhicule sans cible serait silencieusement ignorée à l'exécution.
22-
val localOnly = setOf(ActionType.LAUNCH_APP, ActionType.SHOW_NOTIFICATION)
22+
val localOnly = setOf(
23+
ActionType.LAUNCH_APP, ActionType.SHOW_NOTIFICATION, ActionType.SPEAK_TEXT
24+
)
2325

2426
ActionType.entries.filterNot { it in localOnly }.forEach { type ->
2527
assertNotNull("${type.name} n'a pas de bridgeAction", type.bridgeAction)
@@ -28,7 +30,7 @@ class CatalogConsistencyTest {
2830

2931
@Test
3032
fun `les actions locales ne passent pas par le pont`() {
31-
listOf(ActionType.LAUNCH_APP, ActionType.SHOW_NOTIFICATION).forEach { type ->
33+
listOf(ActionType.LAUNCH_APP, ActionType.SHOW_NOTIFICATION, ActionType.SPEAK_TEXT).forEach { type ->
3234
assertTrue(
3335
"${type.name} ne touche pas le véhicule et ne doit pas avoir de bridgeAction",
3436
type.bridgeAction == null

0 commit comments

Comments
 (0)