27
27
28
28
def _map_exception (func : Func ) -> Func :
29
29
"""
30
- Creates a decorator that wraps a function and maps any raised `MqttError` exception to a `MQTTException`.
30
+ Creates a decorator that wraps a function and maps any raised `MqttError`
31
+ exception to a `MQTTException`.
31
32
32
33
:param func: The function to be wrapped.
33
34
:type func: Func
@@ -37,7 +38,8 @@ def _map_exception(func: Func) -> Func:
37
38
@wraps (func )
38
39
async def inner (* args : Any , ** kwargs : Any ) -> Any :
39
40
"""
40
- Decorator for asynchronous functions that catches `MqttError` exceptions and raises `MQTTException` instead.
41
+ Decorator for asynchronous functions that catches `MqttError` exceptions
42
+ and raises `MQTTException` instead.
41
43
42
44
Parameters:
43
45
func (Callable): The function to be decorated.
@@ -117,10 +119,10 @@ async def connect(self, timeout: int = 10) -> None:
117
119
async def disconnect (self ) -> None :
118
120
"""
119
121
This function is an asynchronous method that handles the disconnection of the client.
120
-
122
+
121
123
Parameters:
122
124
self: The current instance of the class.
123
-
125
+
124
126
Returns:
125
127
None
126
128
"""
@@ -135,8 +137,10 @@ async def subscribe(self, topics: List[Tuple[str, int]]) -> None:
135
137
Subscribe to the given list of topics.
136
138
137
139
Args:
138
- topics (List[Tuple[str, int]]): A list of tuples representing the topics to subscribe to.
139
- Each tuple should contain a string representing the topic name and an integer representing the QoS level.
140
+ topics (List[Tuple[str, int]]): A list of tuples representing the topics
141
+ to subscribe to.
142
+ Each tuple should contain a string representing the topic name and
143
+ an integer representing the QoS level.
140
144
141
145
Returns:
142
146
None: This function does not return anything.
@@ -191,7 +195,7 @@ def _on_message(
191
195
def message_queue (self ) -> "asyncio.Queue[MQTTMessage]" :
192
196
"""
193
197
Returns the message queue for receiving MQTT messages.
194
-
198
+
195
199
:return: The message queue for receiving MQTT messages.
196
200
:rtype: asyncio.Queue[MQTTMessage]
197
201
"""
0 commit comments