class documentation

Will Agent

The subscription is used to handle the MQTT will message when published by the broker on behalf of another client that has gone off line (e.g. jmri). The subscription is remote client specific and an instance is required for each remote client to be monitored.

This agent does not publish.

Method __init__ Initialise the will subscription
Method handle_publication Handle will publication

Inherited from MQTTAgent:

Method get_filter Get the topic filter for this subscription
Method matches check if topic matches filter
Method _create_pub_check Create Publication check task
Class Variable _client Undocumented
Class Variable _dcc Undocumented
Instance Variable _qos Undocumented
Instance Variable _topic_filter Undocumented
def __init__(self, topic_filter, qos):

Initialise the will subscription

Parameters
topic_filterthe topic filter to match against received topics
qosthe Quality of Service for this subscription. Must be either MQTTClient.QoS0 or MQTTClient.QoS1
def handle_publication(self, topic, dup_flag, ret_flag, payload):

Handle will publication

This method is called by the MQTT client when a will publication is received.

TODO What to do with this?

retained 1 payload 'OFFLINE' on initial connection indicates JMRI not available retained 0 payload 'OFFLINE' during connection indicates JMRI connection now closed retained 0 payload '' during connection indicates JMRI now available.

Parameters
topicthe topic of the publication
dup_flagTrue if this is a duplicate publication
ret_flagTrue if this is a retained publication
payloadthe payload of the publication as a string