Skip to content

Commit 17699e7

Browse files
author
Jim Bennett
committed
Removing try method and unnecessary comment
1 parent 468de41 commit 17699e7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

adafruit_azureiot/iot_mqtt.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def device_twin_desired_updated(self, desired_property_name: str, desired_proper
9191
:param int desired_version: The version of the desired property that was updated
9292
"""
9393

94-
def device_twin_reported_updated(self, reported_property_name: str, reported_property_value, reported_version: int,) -> None:
94+
def device_twin_reported_updated(self, reported_property_name: str, reported_property_value, reported_version: int) -> None:
9595
"""Called when the device twin reported values are updated
9696
:param str reported_property_name: The name of the reported property that was updated
9797
:param reported_property_value: The value of the reported property that was updated
@@ -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,9 +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-
self._try_create_mqtt_client(self._hostname)
147-
148144
# pylint: disable=C0103, W0613
149145
def _on_connect(self, client, userdata, _, rc) -> None:
150146
self._logger.info("- iot_mqtt :: _on_connect :: rc = " + str(rc) + ", userdata = " + str(userdata))

0 commit comments

Comments
 (0)