mirror of
https://github.com/meshtastic/python.git
synced 2026-01-14 10:47:59 -05:00
add waypoint parameter
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user