Skip to content

Commit

Permalink
fix MQTT publish error
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-s committed Jan 25, 2022
1 parent 9e7a926 commit 1b54ae3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SunGather/exports/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def on_disconnect(self, client, userdata, rc):
logging.info(f"MQTT: Server Disconnected code: {rc}")

def on_publish(self, client, userdata, mid):
if mid:
try:
self.mqtt_queue.remove(mid)
logging.info(f"MQTT: Message {mid} Published")
except Exception as err:
pass
logging.info(f"MQTT: Message {mid} Published")

def cleanName(self, name):
return name.lower().replace(' ','_')
Expand Down

0 comments on commit 1b54ae3

Please sign in to comment.