-
Notifications
You must be signed in to change notification settings - Fork 183
Plugins
Fabian Affolter edited this page Apr 23, 2014
·
2 revisions
Creating new plugins is rather easy, and I recommend you take the file
plugin
and start from that.
Plugins are invoked with two arguments (srv
and item
). srv
is an object
with some helper functions, and item
a dict which contains information on the message
which is to be handled by the plugin. item
contains the following elements:
item = {
'service' : 'string', # name of handling service (`twitter`, `file`, ..)
'target' : 'string', # name of target (`o1`, `janejol`) in service
'addrs' : <list>, # list of addresses from SERVICE_targets
'config' : dict, # None or dict from SERVICE_config {}
'topic' : 'string', # incoming topic branch name
'payload' : <payload> # raw message payload
'message' : 'string', # formatted message (if no format string then = payload)
'data' : None, # dict with transformation data
'title' : 'mqttwarn', # possible title from title{}
'priority' : 0, # possible priority from priority{}
}