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 |
Handle will publication |
Inherited from MQTTAgent:
| Method | get |
Get the topic filter for this subscription |
| Method | matches |
check if topic matches filter |
| Method | _create |
Create Publication check task |
| Class Variable | _client |
Undocumented |
| Class Variable | _dcc |
Undocumented |
| Instance Variable | _qos |
Undocumented |
| Instance Variable | _topic |
Undocumented |
overrides
rp2da2.mqtt.mqtt.MQTTAgent.__init__Initialise the will subscription
| Parameters | |
| topic | the topic filter to match against received topics |
| qos | the Quality of Service for this subscription. Must be either MQTTClient.QoS0 or MQTTClient.QoS1 |
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 | |
| topic | the topic of the publication |
| dup | True if this is a duplicate publication |
| ret | True if this is a retained publication |
| payload | the payload of the publication as a string |