flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
402 stars 210 forks source link

breaking change in paho-mqtt 2.0 #759

Open gernot-h opened 6 months ago

gernot-h commented 6 months ago

Tried a fresh install today and ended up with:

Traceback (most recent call last):
  File "/root/psa_car_controller/venv/lib/python3.11/site-packages/psa_car_controller/psa/RemoteClient.py", line 105, in start
    self.mqtt_client = mqtt.Client(clean_session=True, protocol=mqtt.MQTTv311)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version'

paho-mqtt 2.0, released on Feb, 10th, now requires an additional argument to mqtt.Client(), see their migration notes.

So we need to either change RemoteClient.py or restrict paho-mqtt versions in pyproject.toml:

paho-mqtt = ">=1.5.0, <2.0.0"

If you let me know which solution you prefer, I can happily prepare a PR. :-)

gernot-h commented 6 months ago

My workaround is in master now, but we might still consider doing the real fix so we could update to paho-mqtt 2.0.