eschava / psmqtt

Utility reporting system health and status via MQTT
MIT License
159 stars 35 forks source link

Fix requirements.txt to use Paho 2 #48

Closed chavaone closed 5 months ago

chavaone commented 5 months ago

I've got the following error when running psmqtt in Docker:

Traceback (most recent call last):
  File "/tmp/psmqtt/psmqtt.py", line 154, in <module>
    run()
  File "/tmp/psmqtt/psmqtt.py", line 100, in run
    mqttc = MqttClient(
            ^^^^^^^^^^^
  File "/tmp/psmqtt/src/task.py", line 37, in __init__
    self.mqttc = paho.Client(paho.CallbackAPIVersion.VERSION1,
                             ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'paho.mqtt.client' has no attribute 'CallbackAPIVersion'

I found out that the code had been adapted for using Paho 2 (https://github.com/eschava/psmqtt/commit/837d8adbf15f2688b992d8729b64b8253476ac02) but the requirements file had not been updated. When I update paho the error disappears.

eschava commented 5 months ago

Thank you! Merged