From 0bc5dce01f94d7b813dfd24aad455a3a080a767e Mon Sep 17 00:00:00 2001 From: Thomas Calmant Date: Mon, 14 Mar 2016 10:49:04 +0100 Subject: [PATCH] Give access to tls_set() and to the Paho client from mqtt_client Early work for #55 --- pelix/misc/mqtt_client.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pelix/misc/mqtt_client.py b/pelix/misc/mqtt_client.py index eae77e7e..9db3575e 100644 --- a/pelix/misc/mqtt_client.py +++ b/pelix/misc/mqtt_client.py @@ -87,12 +87,22 @@ def __init__(self, client_id=None): # MQTT client self.__mqtt = paho.Client(self._client_id) + # Give access to Paho methods to configure TLS + self.tls_set = self.__mqtt.tls_set + # Paho callbacks self.__mqtt.on_connect = self.__on_connect self.__mqtt.on_disconnect = self.__on_disconnect self.__mqtt.on_message = self.__on_message self.__mqtt.on_publish = self.__on_publish + @property + def raw_client(self): + """ + Returns the raw client object, depending on the underlying library + """ + return self.__mqtt + @staticmethod def on_connect(client, result_code): """