diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index d5ac553..036ac13 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -139,6 +139,7 @@ class MQTT: :param int socket_timeout: How often to check socket state for read/write/connect operations, in seconds. :param int connect_retries: How many times to try to connect to broker before giving up. + :param class user_data: arbitrary data to pass as a second argument to the callbacks. """ @@ -159,6 +160,7 @@ def __init__( use_binary_mode=False, socket_timeout=1, connect_retries=5, + user_data=None, ): self._socket_pool = socket_pool @@ -176,7 +178,7 @@ def __init__( self._connect_retries = connect_retries self.keep_alive = keep_alive - self._user_data = None + self._user_data = user_data self._is_connected = False self._msg_size_lim = MQTT_MSG_SZ_LIM self._pid = 0