Skip to content

Migration from SiriAPI to SiriAPI8

Robin Meis edited this page Feb 1, 2015 · 1 revision

To use commands you created on SiriAPI, you will need to change them to the new format. You can find a full example of the command definition in SiriAPI here.

In SiriAPI keywords were defined like this:

self.keywords.append({'find': [['hello', '*'], 'hello'], 'call': 'hello'})

Now they are defined like this:

SiriAPI.action.add([['hello', '*'], 'hello'], hello)

As you can see the find definition hasn't changed. But instead of self.keywords.append you now use SiriAPI.action.add. You don't add a value to a list anymore, instead you call a function of the integrated action handler. This function takes two parameters. The first is the find definition and the second is the function which has to be called. The function is no longer in qoutation marks and the find and call key are not used anymore.

The commands.py has been removed. Instead you just call the function in the same Python file where you also initialize SiriAPI8 with username and password. Your functions can also be created in this file. When you just started using SiriAPI8 you could modify the example.py

If you have any question about the migration, don't hesitate to ask in the issue tracker

Clone this wiki locally