@@ -250,7 +250,7 @@ def sendText(
250
250
destinationId : Union [int , str ]= BROADCAST_ADDR ,
251
251
wantAck : bool = False ,
252
252
wantResponse : bool = False ,
253
- onResponse : Optional [Callable [[mesh_pb2 . MeshPacket ], Any ]]= None ,
253
+ onResponse : Optional [Callable [[dict ], Any ]]= None ,
254
254
channelIndex : int = 0 ,
255
255
):
256
256
"""Send a utf8 string to some other node, if the node has a display it
@@ -290,7 +290,7 @@ def sendData(
290
290
portNum : portnums_pb2 .PortNum .ValueType = portnums_pb2 .PortNum .PRIVATE_APP ,
291
291
wantAck : bool = False ,
292
292
wantResponse : bool = False ,
293
- onResponse : Optional [Callable [[mesh_pb2 . MeshPacket ], Any ]]= None ,
293
+ onResponse : Optional [Callable [[dict ], Any ]]= None ,
294
294
channelIndex : int = 0 ,
295
295
):
296
296
"""Send a data packet to some other node
@@ -446,7 +446,7 @@ def sendTraceRoute(self, dest: Union[int, str], hopLimit: int, channelIndex: int
446
446
waitFactor = min (len (self .nodes ) - 1 if self .nodes else 0 , hopLimit )
447
447
self .waitForTraceRoute (waitFactor )
448
448
449
- def onResponseTraceRoute (self , p ):
449
+ def onResponseTraceRoute (self , p : dict ):
450
450
"""on response for trace route"""
451
451
routeDiscovery = mesh_pb2 .RouteDiscovery ()
452
452
routeDiscovery .ParseFromString (p ["decoded" ]["payload" ])
@@ -500,7 +500,7 @@ def sendTelemetry(self, destinationId: Union[int,str]=BROADCAST_ADDR, wantRespon
500
500
if wantResponse :
501
501
self .waitForTelemetry ()
502
502
503
- def onResponseTelemetry (self , p ):
503
+ def onResponseTelemetry (self , p : dict ):
504
504
"""on response for telemetry"""
505
505
if p ["decoded" ]["portnum" ] == 'TELEMETRY_APP' :
506
506
self ._acknowledgment .receivedTelemetry = True
@@ -523,7 +523,7 @@ def onResponseTelemetry(self, p):
523
523
if p ["decoded" ]["routing" ]["errorReason" ] == 'NO_RESPONSE' :
524
524
our_exit ("No response from node. At least firmware 2.1.22 is required on the destination node." )
525
525
526
- def _addResponseHandler (self , requestId : int , callback : Callable ):
526
+ def _addResponseHandler (self , requestId : int , callback : Callable [[ dict ], Any ] ):
527
527
self .responseHandlers [requestId ] = ResponseHandler (callback )
528
528
529
529
def _sendPacket (self , meshPacket : mesh_pb2 .MeshPacket , destinationId : Union [int ,str ]= BROADCAST_ADDR , wantAck : bool = False ):
0 commit comments