Benoit3 / Diematic_to_MQTT

MQTT interface for De Dietrich Diematic3 heater regulator written in python
MIT License
25 stars 7 forks source link

Compatibility issue with Paho-MQTT 2.0 #18

Closed rofiq65 closed 7 months ago

rofiq65 commented 7 months ago

Hi After upgrading Paho-MQTT to version 2.0 there is a “callback_api_version” issue without possibility to launch the diematic service. So to make it compatible with paho-mqtt 2.0, there is a quick fix by just changing in Diematic32MQTT.py Line 322

client = mqtt.Client()

to

client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)

Merci Rofiq

Benoit3 commented 7 months ago

Hi, thank you for the quick return. To keep compatibility with Paho MQTT v1.xx (and not request users to upgrade it now) , I propose following modification ready on the branch

I've tested it OK with paho mqtt v1.61. Can you test it on your system (with Paho MQTT V2.0 if I understand well) ?

Log in DEBUG mode shows the Paho version detected. Regards, Benoit

Benoit3 commented 7 months ago

Correction commit replaced by this one

rofiq65 commented 7 months ago

Hi Benoit Your proposal (both versions) works also with paho-mqtt 2.0.0, perfect! Rofiq

Benoit3 commented 7 months ago

Corrected with release v1.2.5