MqttMonitor/MqttClient.py

branch
eric7
changeset 138
871d54655ef1
parent 132
b4fde9ee3d83
child 139
b7ca79939cc7
diff -r 306b44039633 -r 871d54655ef1 MqttMonitor/MqttClient.py
--- a/MqttMonitor/MqttClient.py	Tue Jul 11 15:33:11 2023 +0200
+++ b/MqttMonitor/MqttClient.py	Wed Aug 30 13:30:42 2023 +0200
@@ -156,7 +156,14 @@
         self.__mqttClient.on_log = self.__onLog
         self.__mqttClient.on_publish = self.__onPublish
 
-    def __onConnectV3(self, client, userdata, flags, rc, properties=None):  # noqa: U100
+    def __onConnectV3(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        flags,
+        rc,
+        properties=None,  # noqa: U100
+    ):
         """
         Private method to handle the connect to the broker (MQTT v3.1 and v3.1.1).
 
@@ -173,7 +180,12 @@
         """
         self.onConnectV3.emit(flags, rc)
 
-    def __onDisconnectedV3(self, client, userdata, rc):  # noqa: U100
+    def __onDisconnectedV3(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        rc,
+    ):
         """
         Private method to handle the disconnect from the broker (MQTT v3.1 and v3.1.1).
 
@@ -186,7 +198,13 @@
         """
         self.onDisconnectedV3.emit(rc)
 
-    def __onSubscribeV3(self, client, userdata, mid, grantedQos):  # noqa: U100
+    def __onSubscribeV3(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        mid,
+        grantedQos,
+    ):
         """
         Private method to handle a subscribe event (MQTT v3.1 and v3.1.1).
 
@@ -201,7 +219,12 @@
         """
         self.onSubscribeV3.emit(mid, grantedQos)
 
-    def __onUnsubscribeV3(self, client, userdata, mid):  # noqa: U100
+    def __onUnsubscribeV3(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        mid,
+    ):
         """
         Private method to handle an unsubscribe event (MQTT v3.1 and v3.1.1).
 
@@ -214,7 +237,12 @@
         """
         self.onUnsubscribeV3.emit(mid)
 
-    def __onMessageV3(self, client, userdata, message):  # noqa: U100
+    def __onMessageV3(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        message,
+    ):
         """
         Private method to handle a new message received from the broker (MQTT v3.1
         and v3.1.1).
@@ -230,7 +258,14 @@
             message.topic, message.payload, message.qos, message.retain
         )
 
-    def __onConnectV5(self, client, userdata, flags, rc, properties=None):  # noqa: U100
+    def __onConnectV5(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        flags,
+        rc,
+        properties=None,
+    ):
         """
         Private method to handle the connect to the broker (MQTT v5.0).
 
@@ -252,7 +287,13 @@
             properties.json() if properties is not None else {},
         )
 
-    def __onDisconnectedV5(self, client, userdata, rc, properties=None):  # noqa: U100
+    def __onDisconnectedV5(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        rc,
+        properties=None,  # noqa: U100
+    ):
         """
         Private method to handle the disconnect from the broker (MQTT v5.0).
 
@@ -273,8 +314,14 @@
             resultCode = rc.value
         self.onDisconnectedV5.emit(resultCode, packetType)
 
-    def __onSubscribeV5(self, client, userdata, mid, reasonCodes, properties=None):
-        # noqa: U100
+    def __onSubscribeV5(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        mid,
+        reasonCodes,
+        properties=None,
+    ):
         """
         Private method to handle a subscribe event (MQTT v5.0).
 
@@ -295,8 +342,14 @@
             properties.json() if properties is not None else {},
         )
 
-    def __onUnsubscribeV5(self, client, userdata, mid, properties, reasonCodes):
-        # noqa: U100
+    def __onUnsubscribeV5(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        mid,
+        properties,
+        reasonCodes,
+    ):
         """
         Private method to handle an unsubscribe event (MQTT v5.0).
 
@@ -318,7 +371,12 @@
             properties.json() if properties is not None else {},
         )
 
-    def __onMessageV5(self, client, userdata, message):  # noqa: U100
+    def __onMessageV5(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        message,
+    ):
         """
         Private method to handle a new message received from the broker (MQTT v5.0).
 
@@ -337,7 +395,13 @@
             message.properties.json(),
         )
 
-    def __onLog(self, client, userdata, level, buf):  # noqa: U100
+    def __onLog(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        level,
+        buf,
+    ):
         """
         Private method to handle a log event (MQTT v3.1, v3.1.1 and v5.0).
 
@@ -352,7 +416,12 @@
         """
         self.onLog.emit(level, buf)
 
-    def __onPublish(self, client, userdata, mid):  # noqa: U100
+    def __onPublish(
+        self,
+        client,  # noqa: U100
+        userdata,  # noqa: U100
+        mid,
+    ):
         """
         Private method to handle the publishing of a message (MQTT v3.1, v3.1.1
         and v5.0).

eric ide

mercurial