Skip to content

Commit 57f0598

Browse files
committed
Fix some pylint complaints
1 parent 7cc18e9 commit 57f0598

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

examples/waypoint.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import argparse
88
import datetime
99
import sys
10-
import time
1110

1211
import meshtastic
1312
import meshtastic.serial_interface
@@ -42,7 +41,7 @@
4241
with meshtastic.serial_interface.SerialInterface(args.port, debugOut=d) as iface:
4342
if args.cmd == 'create':
4443
p = iface.sendWaypoint(
45-
id=int(args.id),
44+
waypoint_id=int(args.id),
4645
name=args.name,
4746
description=args.description,
4847
expire=int(datetime.datetime.fromisoformat(args.expire).timestamp()),

meshtastic/mesh_interface.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,14 @@ def sendWaypoint(
720720
name,
721721
description,
722722
expire: int,
723-
id: Optional[int] = None,
723+
waypoint_id: Optional[int] = None,
724724
latitude: float = 0.0,
725725
longitude: float = 0.0,
726726
destinationId: Union[int, str] = BROADCAST_ADDR,
727727
wantAck: bool = True,
728728
wantResponse: bool = False,
729729
channelIndex: int = 0,
730-
):
730+
): # pylint: disable=R0913
731731
"""
732732
Send a waypoint packet to some other node (normally a broadcast)
733733
@@ -738,14 +738,14 @@ def sendWaypoint(
738738
w.name = name
739739
w.description = description
740740
w.expire = expire
741-
if id is None:
741+
if waypoint_id is None:
742742
# Generate a waypoint's id, NOT a packet ID.
743743
# same algorithm as https://github.com/meshtastic/js/blob/715e35d2374276a43ffa93c628e3710875d43907/src/meshDevice.ts#L791
744744
seed = secrets.randbits(32)
745745
w.id = math.floor(seed * math.pow(2, -32) * 1e9)
746746
logging.debug(f"w.id:{w.id}")
747747
else:
748-
w.id = id
748+
w.id = waypoint_id
749749
if latitude != 0.0:
750750
w.latitude_i = int(latitude * 1e7)
751751
logging.debug(f"w.latitude_i:{w.latitude_i}")
@@ -773,7 +773,7 @@ def sendWaypoint(
773773

774774
def deleteWaypoint(
775775
self,
776-
id: int,
776+
waypoint_id: int,
777777
destinationId: Union[int, str] = BROADCAST_ADDR,
778778
wantAck: bool = True,
779779
wantResponse: bool = False,
@@ -788,7 +788,7 @@ def deleteWaypoint(
788788
can be used to track future message acks/naks.
789789
"""
790790
p = mesh_pb2.Waypoint()
791-
p.id = id
791+
p.id = waypoint_id
792792
p.expire = 0
793793

794794
if wantResponse:

0 commit comments

Comments
 (0)