Closed
Description
Currently, this library returns a message callback containing a topic and payload if a subscription has been updated.
While one could filter for a specific MQTT topic within the on_message
method, it is clunky.
This enhancement would add message callbacks which only trigger on a specific topic match.
Note: Topics must be subscribed to, prior to adding the callback handler.
Proposed methods:
message_callback_add(mqtt_topic, callback_method)
: Connect a user-defined method to a MQTT subscription topic.
message_callback_remove(mqtt_topic, callback_method)
: Remove a user-defined method from a specific mqtt topic.
Example Usage in Paho MQTT Python: https://github.com/eclipse/paho.mqtt.python/blob/master/examples/client_sub-multiple-callback.py#L45