Skip to content

Commit

Permalink
first attempt to add InsertText intent
Browse files Browse the repository at this point in the history
updated:

- alexa.py (main logic)
- ./speech_assets/SampleUtterances.xx.txt (Intent)
- ./speech_assets/IntentSchema.json (Intent)
- utterances.xx.txt (Intent)
- templates.xx.yaml (answer card)
  • Loading branch information
YantCaccia committed Oct 22, 2020
1 parent db00bab commit 25809fb
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Most everything you can do with a remote or keyboard is supported in the skill,
- Shutdown/reboot/sleep/hibernate system
- Toggle fullscreen
- Eject media
- Send text

Instead of providing the exact verbiage here for each command, we strive to make the experience as natural as we can. Simply try asking for what you want in a way that feels _right_ to you. If a particular phrase doesn't work and you think it should, see [Getting Help](#getting-help) to notify us and we will see what we can do to accommodate the phrase you prefer.

Expand Down
8 changes: 8 additions & 0 deletions alexa.py
Original file line number Diff line number Diff line change
Expand Up @@ -2932,5 +2932,13 @@ def alexa_launch():
def session_ended():
return "{}", 200

@ask.intent('InsertText')
@preflight_check
def alexa_insert_text(kodi, someText):
card_title = render_template('sending_text', textToBeSent=someText).encode('utf-8')
log.info(card_title)
kodi.SendText(someText)
return statement('').simple_card(card_title, '')


# End of intent methods
9 changes: 9 additions & 0 deletions speech_assets/IntentSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,15 @@
"type": "SHOWS"
}
]
},
{
"intent": "InsertText",
"slots": [
{
"name": "someText",
"type": "AMAZON.SearchQuery"
}
]
}
]
}
2 changes: 2 additions & 0 deletions speech_assets/SampleUtterances.de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ Hibernate system ruhezustand
Hibernate system tiefschlaf
Hibernate tiefschlaf
Home startseite
InsertText schreibst {someText}
InsertText eingeben {someText}
Left links
Left nach links
Left navigier links
Expand Down
2 changes: 2 additions & 0 deletions speech_assets/SampleUtterances.en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Info show info window
Info show information
Info show information dialog
Info show information window
InsertText write {someText}
InsertText insert {someText}
Left go left
Left left
Left navigate left
Expand Down
2 changes: 2 additions & 0 deletions speech_assets/SampleUtterances.es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ Info ver el dialogo de info
Info ver el dialogo de informacion
Info ver la ventana de info
Info ver la ventana de informacion
InsertText escribes {someText}
InsertText insertar {someText}
Left ir izquierda
Left izquierda
Left navegar izquierda
Expand Down
2 changes: 2 additions & 0 deletions speech_assets/SampleUtterances.fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ Info ouvre la fenêtre d' info
Info ouvre la fenêtre d' informations
Info ouvre le dialogue d' info
Info ouvre le dialogue d' informations
InsertText ecrivez {someText}
InsertText entrez {someText}
Left gauche
Left va à gauche
ListenToAlbum joue l'album {Album}
Expand Down
2 changes: 2 additions & 0 deletions speech_assets/SampleUtterances.it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ Info visualizza info
Info visualizza informazioni
Info visualizza la finestra info
Info visualizza la finestra informazioni
InsertText scrivi {someText}
InsertText inserisci {someText}
Left a sinistra
Left alla sinistra
Left naviga a sinistra
Expand Down
2 changes: 2 additions & 0 deletions templates.de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ remaining_min: "Es ist noch eine Minute übrig"

remaining_time: ", und die Wiedergabe wird um {{ end_time }} enden"

sending_text: "Senden {{ textToBeSent }}"


############################
## General Templates ##
Expand Down
2 changes: 2 additions & 0 deletions templates.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ remaining_min: "There is one minute remaining"

remaining_time: ", and it will end at {{ end_time }}"

sending_text: "Sending {{ textToBeSent }}"


############################
## General Templates ##
Expand Down
2 changes: 2 additions & 0 deletions templates.es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ remaining_min: "Queda un minuto"

remaining_time: ", y acabará a las {{ end_time }}"

sending_text: "Enviando {{ textToBeSent }}"


############################
## General Templates ##
Expand Down
2 changes: 2 additions & 0 deletions templates.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ remaining_min: "Il reste une minute"

remaining_time: ", et se terminera à {{ end_time }}"

sending_text: "Envoi {{ textToBeSent }}"


############################
## General Templates ##
Expand Down
2 changes: 2 additions & 0 deletions templates.it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ remaining_min: "Manca un minuto"

remaining_time: ", e terminerà alle {{ end_time }}"

sending_text: "Sto inviando {{ textToBeSent }}"


############################
## General Templates ##
Expand Down
2 changes: 2 additions & 0 deletions utterances.de.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,5 @@ AddonGlobalSearch (suche/suche nach/finde) {Artist}

AMAZON.HelpIntent (/nach) was ich es fragen kann
AMAZON.HelpIntent was es (/alles) kann

InsertText (schreibst/eingeben) {someText}
2 changes: 2 additions & 0 deletions utterances.en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,5 @@ AddonGlobalSearch (find/search for) {Artist}

AMAZON.HelpIntent what can (you do/i ask you)
AMAZON.HelpIntent things to try

InsertText (write/insert) {someText}
4 changes: 3 additions & 1 deletion utterances.es.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,6 @@ AddonGlobalSearch (encontrar/buscar) {Album}
AddonGlobalSearch (encontrar/buscar) {Artist}

AMAZON.HelpIntent que puedes hacer
AMAZON.HelpIntent cosas que probar
AMAZON.HelpIntent cosas que probar

InsertText (escribes/insertas) {someText}
2 changes: 2 additions & 0 deletions utterances.fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,5 @@ AddonGlobalSearch (cherche/recherche) {Artist}
AMAZON.HelpIntent (que puis-je/qu'est-ce que je peux) te demander
AMAZON.HelpIntent (que peux-tu/qu'est-ce que tu peux) faire
AMAZON.HelpIntent choses à essayer

InsertText (entrez/ecrivez) {someText}
2 changes: 2 additions & 0 deletions utterances.it.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,5 @@ AddonGlobalSearch (trova/cerca) {Artist}

AMAZON.HelpIntent cosa (puoi fare/posso chiederti)
AMAZON.HelpIntent cose da provare

InsertText (scrivi/inserisci) {someText}

0 comments on commit 25809fb

Please sign in to comment.