Skip to content

Commit 9ae6555

Browse files
authored
Update reference.rst
Updates the documentation to include the 'retain' flag.
1 parent b227b12 commit 9ae6555

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/reference.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,14 @@ An optional ``str_expr`` can be used to match the MQTT message data, and the tri
778778
if that expression evaluates to ``True`` or non-zero. This expression has available these
779779
variables:
780780

781-
- ``trigger_type`` is set to "mqtt"
782-
- ``topic`` is set to the topic the message was received on
781+
- ``trigger_type`` is set to "mqtt".
782+
- ``topic`` is set to the topic the message was received on.
783783
- ``qos`` is set to the message QoS.
784-
- ``payload`` is set to the string payload of the message
784+
- ``payload`` is set to the string payload of the message.
785785
- ``payload_obj`` if the payload was valid JSON, this will be set to the native Python object
786786
representing that payload. A null message will not be converted. If payload_obj is a
787787
required function argument an exception will be thrown, use payload_obj=None.
788+
- ``retain`` is set to the message retain flag. True if the message was retained, False otherwise.
788789

789790
When the ``@mqtt_trigger`` occurs, those same variables are passed as keyword arguments to the
790791
function in case it needs them. Additional keyword parameters can be specified by setting the

0 commit comments

Comments
 (0)