Skip to content

Commit d7d4a66

Browse files
author
Jim Bennett
committed
Removing on_message as it's no longer needed
1 parent 3eed9fc commit d7d4a66

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

adafruit_azureiot/iot_mqtt.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def _create_mqtt_client(self) -> None:
132132

133133
# set actions to take throughout connection lifecycle
134134
self._mqtts.on_connect = self._on_connect
135-
self._mqtts.on_message = self._on_message
136135
self._mqtts.on_log = self._on_log
137136
self._mqtts.on_publish = self._on_publish
138137
self._mqtts.on_disconnect = self._on_disconnect
@@ -255,27 +254,6 @@ def _handle_cloud_to_device_message(self, client, topic: str, msg: str) -> None:
255254
self._callback.cloud_to_device_message_received(msg, properties)
256255
gc.collect()
257256

258-
# pylint: disable=W0702, R0912
259-
def _on_message(self, client, msg_topic, payload) -> None:
260-
topic = ""
261-
msg = None
262-
263-
self._logger.info("- iot_mqtt :: _on_message")
264-
265-
if payload is not None:
266-
try:
267-
msg = payload.decode("utf-8")
268-
except:
269-
msg = str(payload)
270-
271-
if msg_topic is not None:
272-
try:
273-
topic = msg_topic.decode("utf-8")
274-
except:
275-
topic = str(msg_topic)
276-
277-
self._logger.error("ERROR: (unknown message) - {} on topic {}".format(msg, topic))
278-
279257
def _send_common(self, topic: str, data) -> None:
280258
# Convert data to a string
281259
if isinstance(data, dict):

0 commit comments

Comments
 (0)