This shortcut uses my Get My Access Token and Get Vehicle ID shortcuts and is used by my Headed Home shortcut. See the Collection Tesla Triggers.
This shortcut sends an address to the in-car nav.
Address is explicit in the shortcut. Referencing your Contacts address or allowing an address to be entered on run are potential enhancements.
Novidades
Versão 1.0
First release
O que ele faz
7 ações-
Run ShortcutGet My Access Token
-
Text
-
Run ShortcutGet Vehicle ID
-
Street Address
-
URLhttps://owner-api.teslamotors.com/api/1/vehicles/…/command/navigation_request
-
Get Contents of URL
-
Get Dictionary Value
Ver como código
Todas as ações deste atalho escritas em Cherri, uma linguagem de programação para o app Atalhos. Ótimo para aprender como ele funciona.
#include 'actions/web'
#include 'actions/location'
#define color lightblue
#define glyph locationPin
const access_token = runSelf()
const vehicle_id = runSelf()
streetAddress("", "", "", "", "", 0)
url("https://owner-api.teslamotors.com/api/1/vehicles/{vehicle_id}/command/navigation_request")
jsonRequest("", "POST", {
"locale": "en-US",
"timestamp_ms": "1539465730",
"type": "share_ext_content_raw",
"value": {
"android.intent.ACTION": "android.intent.action.SEND",
"android.intent.TYPE": "text\\/plain",
"android.intent.extra.SUBJECT": "Place Name",
"android.intent.extra.TEXT": "{}"
}
}, {
"Authorization": "Bearer {access_token}"
})
Abrir no Cherri Playground
Descompilado com cherri 2.3.0 (GPL-2.0). Pode precisar de pequenos ajustes antes de compilar.
Avaliações e comentários
Escrever uma avaliação–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Ainda não há avaliações. Seja o primeiro a compartilhar o que você pensa!
Publicidade
Mais de gwgans
Você também pode gostar
Publicidade