Skip to content

Commit 18b7c50

Browse files
authored
Merge pull request #14 from brentru/patch-mmqtt
Remove workaround for MiniMQTT (Issue #25)
2 parents f3ff110 + 17699e7 commit 18b7c50

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

adafruit_azureiot/iot_mqtt.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,11 @@ def _gen_sas_token(self) -> str:
114114
token = "SharedAccessSignature sr={}&sig={}&se={}".format(uri, signature, token_expiry)
115115
return token
116116

117-
# Workaround for https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/issues/25
118-
def _try_create_mqtt_client(self, hostname: str) -> None:
117+
def _create_mqtt_client(self) -> None:
119118
minimqtt.set_socket(self._socket, self._iface)
120119

121120
self._mqtts = MQTT(
122-
broker=hostname,
121+
broker=self._hostname,
123122
username=self._username,
124123
password=self._passwd,
125124
port=8883,
@@ -142,13 +141,6 @@ def _try_create_mqtt_client(self, hostname: str) -> None:
142141
self._mqtts.last_will()
143142
self._mqtts.connect()
144143

145-
def _create_mqtt_client(self) -> None:
146-
try:
147-
self._try_create_mqtt_client(self._hostname)
148-
except ValueError:
149-
# Workaround for https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT/issues/25
150-
self._try_create_mqtt_client("https://" + self._hostname)
151-
152144
# pylint: disable=C0103, W0613
153145
def _on_connect(self, client, userdata, _, rc) -> None:
154146
self._logger.info("- iot_mqtt :: _on_connect :: rc = " + str(rc) + ", userdata = " + str(userdata))

0 commit comments

Comments
 (0)