import kns def callback(directive, options): print "This is the callback." print "\tDirective: " + directive print "\tText: " + options["text"] params = {'text': 'Hello, there!'} result = kns.raise_event("test", "started", "a163x36", params, callback, True) print "\nThe raw directives were the following: \n%s" % result
import kns # Raises the "coming_home" event, which is handled by the ruleset result = kns.raise_event("phone", "incoming_call", "a163x128", {}, None, True) print result
import kns # Raises the "coming_home" event, which is handled by the ruleset result = kns.raise_event("location", "nearing_home", "a163x128", {}, None, True) print result