From 4abd0cde060cba090122b8f67799173d410128ba Mon Sep 17 00:00:00 2001 From: Marco Stoffel Date: Wed, 5 Jun 2024 12:14:37 +0200 Subject: [PATCH 1/3] Migrate paho mqtt_client.CallbackAPIVersion.VERSION1 parameter to client creation --- tedge_modbus/reader/reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tedge_modbus/reader/reader.py b/tedge_modbus/reader/reader.py index df1e9b4..e505678 100644 --- a/tedge_modbus/reader/reader.py +++ b/tedge_modbus/reader/reader.py @@ -374,7 +374,7 @@ def connect_to_tedge(self): broker = self.base_config["thinedge"]["mqtthost"] port = self.base_config["thinedge"]["mqttport"] client_id = "modbus-client" - client = mqtt_client.Client(client_id) + client = mqtt_client.Client(mqtt_client.CallbackAPIVersion.VERSION1,client_id) client.connect(broker, port) self.logger.debug("Connected to MQTTT broker at %s:%d", broker, port) return client From b73c9fc4c962a20992a7f880c8b49bfb8d711a68 Mon Sep 17 00:00:00 2001 From: Marco Stoffel Date: Wed, 5 Jun 2024 14:25:21 +0200 Subject: [PATCH 2/3] paho 2.0 requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 646e35e..284faa4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -paho-mqtt~=1.6.1 +paho-mqtt>=2.0.0 pymodbus==3.0.2 watchdog~=2.1.9 pyModbusTCP From 73740b868cf7a5831066e598c9867f4578e9503d Mon Sep 17 00:00:00 2001 From: Marco Stoffel Date: Wed, 5 Jun 2024 16:53:41 +0200 Subject: [PATCH 3/3] Format --- tedge_modbus/reader/reader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tedge_modbus/reader/reader.py b/tedge_modbus/reader/reader.py index e505678..963d5b2 100644 --- a/tedge_modbus/reader/reader.py +++ b/tedge_modbus/reader/reader.py @@ -374,7 +374,9 @@ def connect_to_tedge(self): broker = self.base_config["thinedge"]["mqtthost"] port = self.base_config["thinedge"]["mqttport"] client_id = "modbus-client" - client = mqtt_client.Client(mqtt_client.CallbackAPIVersion.VERSION1,client_id) + client = mqtt_client.Client( + mqtt_client.CallbackAPIVersion.VERSION1, client_id + ) client.connect(broker, port) self.logger.debug("Connected to MQTTT broker at %s:%d", broker, port) return client