botlib.broker
index
/home/witling/dev/botlib/botlib/broker.py

 
Modules
       
base64
json

 
Classes
       
builtins.object
Broker

 
class Broker(builtins.object)
    Respresents a connection to the MQTT broker.
 
  Methods defined here:
__init__(self, bot, host='Broker', port=1883, subscriptions=None)
Create an instance and connect to broker.
 
:param bot: reference to the `Bot` instance.
:param host: the hoststring for the broker.
:param port: the port of the broker.
:param subscriptions: a dictionary in the form `topic name (string) => function to execute (callback)`. callback must be 
able to receive three arguments - namely `client_id`, `userdata`, `message`.
send_file(self, topic, payload)
Send a file to the broker.
 
:param topic: mqtt topic to which the message will be published.
:param payload: the binary content of the file.
send_message(self, topic, message)
Send a text message to the broker.
 
:param topic: mqtt topic to which the message will be published.
:param payload: the message as string.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        BROKER_HOST = 'Broker'
BROKER_PORT = 1883