IPWorks IoT 2020 Python Edition

Questions / Feedback?

will_topic Property

The topic that the server should publish the WillMessage to in the event of an ungraceful disconnection.

Syntax

def get_will_topic() -> str: ...
def set_will_topic(value: str) -> None: ...

will_topic = property(get_will_topic, set_will_topic)

Default Value

""

Remarks

This property may be set before calling connect to specify the topic name that the server should publish the will_message on if the connection is closed ungracefully or lost.

MQTT Wills

The Will feature of MQTT allows a client to specify to the server a will_message to publish (as well as a will_topic to publish it on) in the event that the server considers the client lost or ungracefully disconnected.

An "ungraceful disconnection" is any disconnection other than one triggered by calling disconnect. If the client enters sleep mode, the server will not publish the Will. However, if the client is lost as a result of exceeding the sleep duration without sending a message, the server will publish the Will.

In addition to the will_topic and will_message properties, the WillQOS setting may be used to specify the Will message's QoS level, and the WillRetain setting to set the Will message's Retain flag. Refer to those settings for more information.

If will_topic is set to empty string (default) when connect is called, the class will not send a Will to the server.

In MQTTSN, the will_topic, will_message, WillQOS and WillRetain may all be updated using the update_will_message and update_will_topic methods.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Python Edition - Version 20.0 [Build 8265]