compas-dev / compas_eve

COMPAS Event Extensions: adds event-based communication infrastructure to the COMPAS framework.
http://compas.dev/compas_eve/
MIT License
3 stars 1 forks source link

Add support for MQTT-PAHO 2.0 versioned callbacks #8

Open KIKI007 opened 7 months ago

KIKI007 commented 7 months ago

Problem:

In the file mqtt_paho.py when creating a client

self.client = mqtt.Client()

the new mqtt 2.0 version will give a error.

Fix:

from paho.mqtt.enums import CallbackAPIVersion
self.client = mqtt.Client(callback_api_version = CallbackAPIVersion.VERSION1)
gonzalocasas commented 7 months ago

Thanks for identifying this! For the time being, I'm going to release a new version that limits the mqtt paho version to be lower than 2.0, so that we first fix existing installs with minimum breaking changes. Afterwards, I will prepare a PR that adds your fix, or ideally try to update to callback version 2.0 directly!

gonzalocasas commented 7 months ago

Addressed this temporarily in v0.3.5: https://github.com/compas-dev/compas_eve/releases/tag/v0.3.5