mqtt CallbackAPIVersion fix for paho.mqtt >= 2.0.0 #386

Merged
blacklight merged 2 commits from revil-O/platypush:master into master 2024-04-08 23:04:39 +02:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 584f226b62 - Show all commits

View File

@ -37,7 +37,7 @@ class MqttClient(mqtt.Client, threading.Thread):
**kwargs,
):
self.client_id = client_id or str(Config.get('device_id'))
mqtt.Client.__init__(self, *args, client_id=self.client_id, **kwargs)
mqtt.Client.__init__(self, mqtt.CallbackAPIVersion.VERSION1, *args, client_id=self.client_id, **kwargs)
threading.Thread.__init__(self, name=f'MQTTClient:{self.client_id}')
self.logger = logging.getLogger(self.__class__.__name__)