yozik04 / nibe-mqtt

Nibe MQTT integration to use with HomeAssistant MQTT Autodiscovery
GNU General Public License v3.0
26 stars 8 forks source link

paho_mqtt in requirements.txt not limited to Version 1.x. Breaking changes in 2.x. #25

Closed ErikOlufson closed 4 months ago

ErikOlufson commented 4 months ago

Hi,

in mqtt.py paho.mqtt.client is used.

In requirements.txt paho_mqtt is setup with > 1.5.0.

But, since paho_mqtt 2.0 got released some breaking changes were made. Including the client.

Traceback (most recent call last): File "/usr/local/bin/nibe-mqtt", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.11/dist-packages/nibe_mqtt/console_scripts/nibe_mqtt_service.py", line 27, in main service = Service(conf) ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/nibe_mqtt/service.py", line 39, in __init__ self.mqtt_client = MqttConnection(self, conf["mqtt"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/nibe_mqtt/mqtt.py", line 31, in __init__ self._client = Client( ^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/paho/mqtt/client.py", line 766, in __init__ raise ValueError( ValueError: Unsupported callback API version: version 2.0 added a callback_api_version, see migrations.md for details

Maybe it would be a good thing to add "<1.6.x" in requirements.txt or migrate to 2.x ?

What do you thing.

Have a nice weekend!

yozik04 commented 4 months ago

Thank you for the info

yozik04 commented 4 months ago

You can use https://github.com/yozik04/nibe-mqtt/releases/tag/0.5.1 now.