Question: Example script like "Operation send mail"
-
Hello,
I want to create a simple operation using scripting support and python.
The python file should be executed and the parameter to the pythonfile should be the reason the operation triggered.
It should be similar to the "send mail" operation but the parameters should be passed to a python script. Can anybodyd provide some basic information or an example as how to pass the parameters to a python script?
In the end I would like to run an other command from python:
yowsup-cli demos -l XXXX "Test"
where "Test" should be replaced with the trigger reason.
Thanks in advance!
-
MyController supports to execute operations from script. You can pass bindings as
JSON
key-values. For now we cannot pass dynamic detail fromOperations
. But you have query options to communicate with MyController. You can get details like Node, Gateway, Sensors, Rules, Operations, etc., Refer MyController document on downloads pageMyController supports for
Python
scripts. But by default it's not shipped with Python-Java support engine which is www.jython.orgSteps to add new script engine
Download jar file and place it under
mycontroller/lib/
and restart MyController services.
For example if you want to addPython
support on MyController, you need to addJython
library.- Download jython-standalone-*.jar from Jython website.
- Place it under
mycontroller/lib/
- Stop MyContorller
- Start MyController