Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removing try method and unnecessary comment
  • Loading branch information
Jim Bennett committed May 22, 2020
commit 17699e7d58e8128e1548ef2ee9eff68e913d79ac
10 changes: 3 additions & 7 deletions adafruit_azureiot/iot_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def device_twin_desired_updated(self, desired_property_name: str, desired_proper
:param int desired_version: The version of the desired property that was updated
"""

def device_twin_reported_updated(self, reported_property_name: str, reported_property_value, reported_version: int,) -> None:
def device_twin_reported_updated(self, reported_property_name: str, reported_property_value, reported_version: int) -> None:
"""Called when the device twin reported values are updated
:param str reported_property_name: The name of the reported property that was updated
:param reported_property_value: The value of the reported property that was updated
Expand All @@ -114,12 +114,11 @@ def _gen_sas_token(self) -> str:
token = "SharedAccessSignature sr={}&sig={}&se={}".format(uri, signature, token_expiry)
return token

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

self._mqtts = MQTT(
broker=hostname,
broker=self._hostname,
username=self._username,
password=self._passwd,
port=8883,
Expand All @@ -142,9 +141,6 @@ def _try_create_mqtt_client(self, hostname: str) -> None:
self._mqtts.last_will()
self._mqtts.connect()

def _create_mqtt_client(self) -> None:
self._try_create_mqtt_client(self._hostname)

# pylint: disable=C0103, W0613
def _on_connect(self, client, userdata, _, rc) -> None:
self._logger.info("- iot_mqtt :: _on_connect :: rc = " + str(rc) + ", userdata = " + str(userdata))
Expand Down