Skip to content

Commit

Permalink
Give access to tls_set() and to the Paho client from mqtt_client
Browse files Browse the repository at this point in the history
Early work for #55
  • Loading branch information
tcalmant committed Mar 14, 2016
1 parent 903db6b commit 0bc5dce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pelix/misc/mqtt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 0bc5dce

Please sign in to comment.