-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# Scriptable Elements | ||
|
||
Scripts to use with Siri | ||
Metro Madrid has launched a feature to know how long does the next metro train will takes to get to a station. With this scripts it's possible to integrate this functionality with Siri, asking for the waiting times. | ||
|
||
To implement this for a concrete station, it's needed to implement a new script where indicates the number of the station, if Siri have to present UI with the information as a Table and a callback function where the complete information is passed as String. | ||
|
||
```javascript | ||
metroTiming(<Metro Station Number as String>, <Siri will present UI or not as bool>, <callback function>) | ||
``` | ||
|
||
For example: | ||
|
||
This script is used to Barrio del Pilar Station and Siri will speaks all the information returned by the request. | ||
|
||
```javascript | ||
let completionCallback = function(text){ | ||
Speech.speak(text) | ||
} | ||
|
||
metroTiming("902", false, completionCallback); | ||
``` |