Skip to content

Commit

Permalink
refactored to not use bugged paho reinitialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
Towflos committed Oct 8, 2024
1 parent 6ece848 commit 4a8ed19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MAVProxy/modules/mavproxy_mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import numbers

# TODO MQTTv3 vs MQTTv5
# TODO update to CallbackAPIVersion 2

class MqttModule(mp_module.MPModule):

def __init__(self, mpstate):
super(MqttModule, self).__init__(mpstate, "mqtt", "mqtt publisher")
if paho.mqtt.__version__[0] > '1':
self.client = mqtt.Client(callback_api_version=mqtt.CallbackAPIVersion.VERSION1) # TODO update (VERSION1 deprecated)
self.client = mqtt.Client(callback_api_version=mqtt.CallbackAPIVersion.VERSION1)
else:
client = mqtt.Client()
self.client.on_connect = self.on_connect
Expand Down

0 comments on commit 4a8ed19

Please sign in to comment.