@@ -61,7 +61,7 @@ def _validate_keys(connection_string_parts: Mapping) -> None:
6161]
6262
6363
64- class IoTHubDevice (IoTMQTTCallback ):
64+ class IoTHubDevice (IoTMQTTCallback ): # pylint: disable=too-many-instance-attributes
6565 """A device client for the Azure IoT Hub service"""
6666
6767 def connection_status_change (self , connected : bool ) -> None :
@@ -135,7 +135,7 @@ def device_twin_reported_updated(
135135 reported_property_name , reported_property_value , reported_version
136136 )
137137
138- def __init__ (
138+ def __init__ ( # pylint: disable=too-many-arguments
139139 self ,
140140 socket ,
141141 iface ,
@@ -168,7 +168,8 @@ def __init__(
168168 )
169169 except (ValueError , AttributeError ) as e :
170170 raise ValueError (
171- "Connection string is required and should not be empty or blank and must be supplied as a string"
171+ "Connection string is required and should not be empty or blank and must be"
172+ "supplied as a string"
172173 ) from e
173174
174175 if len (cs_args ) != len (connection_string_values ):
@@ -194,7 +195,8 @@ def __init__(
194195
195196 @property
196197 def on_connection_status_changed (self ) -> Callable :
197- """A callback method that is called when the connection status is changed. This method should have the following signature:
198+ """A callback method that is called when the connection status is changed.
199+ This method should have the following signature:
198200 def connection_status_changed(connected: bool) -> None
199201 """
200202 return self ._on_connection_status_changed
@@ -203,40 +205,46 @@ def connection_status_changed(connected: bool) -> None
203205 def on_connection_status_changed (
204206 self , new_on_connection_status_changed : Callable
205207 ) -> None :
206- """A callback method that is called when the connection status is changed. This method should have the following signature:
208+ """A callback method that is called when the connection status is changed.
209+ This method should have the following signature:
207210 def connection_status_changed(connected: bool) -> None
208211 """
209212 self ._on_connection_status_changed = new_on_connection_status_changed
210213
211214 @property
212215 def on_direct_method_invoked (self ) -> Callable :
213- """A callback method that is called when a direct method is invoked. This method should have the following signature:
216+ """A callback method that is called when a direct method is invoked.
217+ This method should have the following signature:
214218 def direct_method_invoked(method_name: str, payload: str) -> IoTResponse:
215219
216- This method returns an IoTResponse containing a status code and message from the method invocation. Set this appropriately
217- depending on if the method was successfully handled or not. For example, if the method was handled successfully, set
218- the code to 200 and message to "OK":
220+ This method returns an IoTResponse containing a status code and message from the method
221+ invocation. Set this appropriately depending on if the method was successfully handled or
222+ not. For example, if the method was handled successfully, set the code to 200 and message
223+ to "OK":
219224
220225 return IoTResponse(200, "OK")
221226 """
222227 return self ._on_direct_method_invoked
223228
224229 @on_direct_method_invoked .setter
225230 def on_direct_method_invoked (self , new_on_direct_method_invoked : Callable ) -> None :
226- """A callback method that is called when a direct method is invoked. This method should have the following signature:
231+ """A callback method that is called when a direct method is invoked.
232+ This method should have the following signature:
227233 def direct_method_invoked(method_name: str, payload: str) -> IoTResponse:
228234
229- This method returns an IoTResponse containing a status code and message from the method invocation. Set this appropriately
230- depending on if the method was successfully handled or not. For example, if the method was handled successfully, set
231- the code to 200 and message to "OK":
235+ This method returns an IoTResponse containing a status code and message from the method
236+ invocation. Set this appropriately depending on if the method was successfully handled or
237+ not. For example, if the method was handled successfully, set the code to 200 and message
238+ to "OK":
232239
233240 return IoTResponse(200, "OK")
234241 """
235242 self ._on_direct_method_invoked = new_on_direct_method_invoked
236243
237244 @property
238245 def on_cloud_to_device_message_received (self ) -> Callable :
239- """A callback method that is called when a cloud to device message is received. This method should have the following signature:
246+ """A callback method that is called when a cloud to device message is received.
247+ This method should have the following signature:
240248 def cloud_to_device_message_received(body: str, properties: dict) -> None:
241249 """
242250 return self ._on_cloud_to_device_message_received
@@ -245,7 +253,8 @@ def cloud_to_device_message_received(body: str, properties: dict) -> None:
245253 def on_cloud_to_device_message_received (
246254 self , new_on_cloud_to_device_message_received : Callable
247255 ) -> None :
248- """A callback method that is called when a cloud to device message is received. This method should have the following signature:
256+ """A callback method that is called when a cloud to device message is received.
257+ This method should have the following signature:
249258 def cloud_to_device_message_received(body: str, properties: dict) -> None:
250259 """
251260 self ._on_cloud_to_device_message_received = (
@@ -254,19 +263,21 @@ def cloud_to_device_message_received(body: str, properties: dict) -> None:
254263
255264 @property
256265 def on_device_twin_desired_updated (self ) -> Callable :
257- """A callback method that is called when the desired properties of the devices device twin are updated.
258- This method should have the following signature:
259- def device_twin_desired_updated(desired_property_name: str, desired_property_value, desired_version: int) -> None:
266+ """A callback method that is called when the desired properties of the devices device twin
267+ are updated. This method should have the following signature:
268+ def device_twin_desired_updated(desired_property_name: str, desired_property_value,
269+ desired_version: int) -> None:
260270 """
261271 return self ._on_device_twin_desired_updated
262272
263273 @on_device_twin_desired_updated .setter
264274 def on_device_twin_desired_updated (
265275 self , new_on_device_twin_desired_updated : Callable
266276 ) -> None :
267- """A callback method that is called when the desired properties of the devices device twin are updated.
268- This method should have the following signature:
269- def device_twin_desired_updated(desired_property_name: str, desired_property_value, desired_version: int) -> None:
277+ """A callback method that is called when the desired properties of the devices device twin
278+ are updated. This method should have the following signature:
279+ def device_twin_desired_updated(desired_property_name: str, desired_property_value,
280+ desired_version: int) -> None:
270281 """
271282 self ._on_device_twin_desired_updated = new_on_device_twin_desired_updated
272283
@@ -275,19 +286,21 @@ def device_twin_desired_updated(desired_property_name: str, desired_property_val
275286
276287 @property
277288 def on_device_twin_reported_updated (self ) -> Callable :
278- """A callback method that is called when the reported properties of the devices device twin are updated.
279- This method should have the following signature:
280- def device_twin_reported_updated(reported_property_name: str, reported_property_value, reported_version: int) -> None:
289+ """A callback method that is called when the reported properties of the devices device twin
290+ are updated. This method should have the following signature:
291+ def device_twin_reported_updated(reported_property_name: str, reported_property_value,
292+ reported_version: int) -> None:
281293 """
282294 return self ._on_device_twin_reported_updated
283295
284296 @on_device_twin_reported_updated .setter
285297 def on_device_twin_reported_updated (
286298 self , new_on_device_twin_reported_updated : Callable
287299 ) -> None :
288- """A callback method that is called when the reported properties of the devices device twin are updated.
289- This method should have the following signature:
290- def device_twin_reported_updated(reported_property_name: str, reported_property_value, reported_version: int) -> None:
300+ """A callback method that is called when the reported properties of the devices device twin
301+ are updated. This method should have the following signature:
302+ def device_twin_reported_updated(reported_property_name: str, reported_property_value,
303+ reported_version: int) -> None:
291304 """
292305 self ._on_device_twin_reported_updated = new_on_device_twin_reported_updated
293306
0 commit comments