diff --git a/examples/waypoint.py b/examples/waypoint.py index 1ce862df..af8dadcc 100644 --- a/examples/waypoint.py +++ b/examples/waypoint.py @@ -7,7 +7,6 @@ import argparse import datetime import sys -import time import meshtastic import meshtastic.serial_interface @@ -42,7 +41,7 @@ with meshtastic.serial_interface.SerialInterface(args.port, debugOut=d) as iface: if args.cmd == 'create': p = iface.sendWaypoint( - id=int(args.id), + waypoint_id=int(args.id), name=args.name, description=args.description, expire=int(datetime.datetime.fromisoformat(args.expire).timestamp()), diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 5f7ba251..aeccc471 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -720,14 +720,14 @@ def sendWaypoint( name, description, expire: int, - id: Optional[int] = None, + waypoint_id: Optional[int] = None, latitude: float = 0.0, longitude: float = 0.0, destinationId: Union[int, str] = BROADCAST_ADDR, wantAck: bool = True, wantResponse: bool = False, channelIndex: int = 0, - ): + ): # pylint: disable=R0913 """ Send a waypoint packet to some other node (normally a broadcast) @@ -738,14 +738,14 @@ def sendWaypoint( w.name = name w.description = description w.expire = expire - if id is None: + if waypoint_id is None: # Generate a waypoint's id, NOT a packet ID. # same algorithm as https://github.com/meshtastic/js/blob/715e35d2374276a43ffa93c628e3710875d43907/src/meshDevice.ts#L791 seed = secrets.randbits(32) w.id = math.floor(seed * math.pow(2, -32) * 1e9) logging.debug(f"w.id:{w.id}") else: - w.id = id + w.id = waypoint_id if latitude != 0.0: w.latitude_i = int(latitude * 1e7) logging.debug(f"w.latitude_i:{w.latitude_i}") @@ -773,7 +773,7 @@ def sendWaypoint( def deleteWaypoint( self, - id: int, + waypoint_id: int, destinationId: Union[int, str] = BROADCAST_ADDR, wantAck: bool = True, wantResponse: bool = False, @@ -788,7 +788,7 @@ def deleteWaypoint( can be used to track future message acks/naks. """ p = mesh_pb2.Waypoint() - p.id = id + p.id = waypoint_id p.expire = 0 if wantResponse: