add waypoint parameter

This commit is contained in:
pdxlocations
2025-10-29 08:58:25 -07:00
parent dcd077d85e
commit 9285f7d13f
2 changed files with 4 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ parser_create = subparsers.add_parser('create', help='Create a new waypoint')
parser_create.add_argument('id', help="id of the waypoint")
parser_create.add_argument('name', help="name of the waypoint")
parser_create.add_argument('description', help="description of the waypoint")
parser_create.add_argument('icon', help="icon of the waypoint")
parser_create.add_argument('expire', help="expiration date of the waypoint as interpreted by datetime.fromisoformat")
parser_create.add_argument('latitude', help="latitude of the waypoint")
parser_create.add_argument('longitude', help="longitude of the waypoint")
@@ -44,6 +45,7 @@ with meshtastic.serial_interface.SerialInterface(args.port, debugOut=d) as iface
waypoint_id=int(args.id),
name=args.name,
description=args.description,
icon=args.icon,
expire=int(datetime.datetime.fromisoformat(args.expire).timestamp()),
latitude=float(args.latitude),
longitude=float(args.longitude),

View File

@@ -830,6 +830,7 @@ class MeshInterface: # pylint: disable=R0902
self,
name,
description,
icon,
expire: int,
waypoint_id: Optional[int] = None,
latitude: float = 0.0,
@@ -848,6 +849,7 @@ class MeshInterface: # pylint: disable=R0902
w = mesh_pb2.Waypoint()
w.name = name
w.description = description
w.icon = icon
w.expire = expire
if waypoint_id is None:
# Generate a waypoint's id, NOT a packet ID.