Fix for the new version of enocean-mqtt
Since enocean-mqtt now requires paho-mqtt >= 2.0, these changes are needed.
I tried to run HA_enoceanmqtt with this PR.
Does not work. Spits out following error:
Exception in thread paho-mqtt-client-enocean_gateway: Traceback (most recent call last): File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner self.run() File "/usr/local/lib/python3.12/threading.py", line 1012, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 4523, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 2297, in loop_forever rc = self._loop(timeout) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 1686, in _loop rc = self.loop_read() ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 2100, in loop_read rc = self._packet_read() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 3142, in _packet_read rc = self._packet_handle() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 3814, in _packet_handle return self._handle_connack() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/paho_mqtt-2.1.0-py3.12.egg/paho/mqtt/client.py", line 3922, in _handle_connack on_connect( TypeError: HACommunicator._on_connect() missing 1 required positional argument: 'properties'
It seems paho-mqtt developers have reversed on 2.1.0 the changes made in 2.0.0: https://github.com/eclipse/paho.mqtt.python/pull/831
So this PR will only work with paho-mqtt==2.0
Have you tried paho-mqtt==2.1 without this PR?