-
Notifications
You must be signed in to change notification settings - Fork 14
API Documentation
This page describes each feature of SiriAPI8.
This example will respond to hello followed by any word with "You said hello to any word"
from SiriAPI8.SiriAPI import *
def hello(q, wildcards): #Answer function
print ("You said Hello to " + wildcards[0])
SiriAPI = SiriAPI("icloud_mail@me.com", "Password") #Create SiriAPI8 object
SiriAPI.action.add([['hello', '*'], hello) #Add answer function for hello *
SiriAPI.connect() #Connect to iCloud
input("Press any key...\n")
SiriAPI.disconnect() #Close connectionSiriAPI(email, password)
Creates a new object of SiriAPI8. Requires your iCloud Mail and password
SiriAPI.connect()
Connects to iCloud with the specified email and password
SiriAPI.disconnect()
Closes connection to iCloud
SiriAPI.action.add(find, call)
Creates a new action based on the search criteria find which will run function call if the spoken text matches. An example for a valid criteria is [['switch light', '*'], ['switch lamp', '*'], 'exact sentence']. The hole criteria has to be in brackets. Stars (*) mark wildcards. At these points any word is valid and will be passed to the function call as a list in the wildcards parameter. There is no limit for wildcards. They have to be seperated from normal text parts. It is possible to declare multiple statements. Each statement has to be in brackets.
Single keywords must not be in brackets and will only trigger an action if the exact sentence is said.
Returns the ID of the action (int)
SiriAPI.action.modify(id, find, call)
Modifies find and call of the action with the ID id. If find or call are set as -1 the old value will be kept. Changing call of id 0, you can set your own not found function. Changing find does not affect the not found function. Possible values for find are explained for action.add Returns (boolean), True if id was found, otherwise False
SiriAPI.action.remove(id)
Remove action with the ID id Returns (boolean), True if id was found, otherwise False. The error action id 0 can't be deleted. It will return False.
SiriAPI.action.list()
Lists all actions in a list
SiriAPI.set_keyword(keyword)
Changes the keyword from iPhone to any string
SiriAPI.get_version()
Returns the version of SiriAPI8 in a string
SiriAPI8 has been developed by Robin Meis