The _is_returning_topic_n_value-field is set within the connection. Default is False (To avoid breaking change)
def connect(self, broker, port=1883, client_id="", clean_session=True, is_returning_topic_n_value=False):
...
"""
`is_returning_topic_n_value` specifies the format of the returned messages on subscription. Either just the values within the topics or the topics and values.
"""
...
self._is_returning_topic_n_value = is_returning_topic_n_value
From a subscribing to a wildcard-topic (#) cannot be determined from which topic a message received from.
Known which topic a message is received from would be a useful feature. Especially when the topics include auto-generated IDs.(cannot be predicted)
For now I have created my own implementation for this issue with the
_on_message_list
-method:The messages are returned in JSON-format:
The
_is_returning_topic_n_value
-field is set within the connection. Default isFalse
(To avoid breaking change)I hope this helps.
Best regards Daniel