Skip to content

Commit 17f7e8e

Browse files
committed
don't check for typoed keyword
1 parent 9b5a889 commit 17f7e8e

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

meshtastic/__main__.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def onConnected(interface):
339339
# can include lat/long/alt etc: latitude = 37.5, longitude = -122.1
340340
interface.getNode(args.dest, False, **getNode_kwargs).setFixedPosition(lat, lon, alt)
341341

342-
if args.set_owner or args.set_owner_short or args.set_is_unmessageable or args.set_is_unmessagable:
342+
if args.set_owner or args.set_owner_short or args.set_is_unmessageable:
343343
closeNow = True
344344
waitForAckNak = True
345345

@@ -360,22 +360,20 @@ def onConnected(interface):
360360
print(f"Setting device owner to {args.set_owner}")
361361
elif args.set_owner_short and not args.set_owner:
362362
print(f"Setting device owner short to {args.set_owner_short}")
363-
unmessageable = (
364-
args.set_is_unmessageable
365-
if args.set_is_unmessageable is not None
366-
else args.set_is_unmessagable
367-
)
368-
set_is_unmessagable = (
369-
meshtastic.util.fromStr(unmessageable)
370-
if isinstance(unmessageable, str)
371-
else unmessageable
372-
)
373-
if set_is_unmessagable is not None:
374-
print(f"Setting device owner is_unmessageable to {set_is_unmessagable}")
375-
interface.getNode(
376-
args.dest, False, **getNode_kwargs).setOwner(long_name=args.set_owner,
377-
short_name=args.set_owner_short, is_unmessagable=set_is_unmessagable
378-
)
363+
364+
if args.set_is_unmessageable:
365+
unmessagable = (
366+
meshtastic.util.fromStr(args.set_is_unmessageable)
367+
if isinstance(args.set_is_unmessageable, str)
368+
else args.set_is_unmessageable
369+
)
370+
371+
if unmessagable is not None:
372+
print(f"Setting device owner is_unmessageable to {unmessagable}")
373+
interface.getNode(
374+
args.dest, False, **getNode_kwargs).setOwner(long_name=args.set_owner,
375+
short_name=args.set_owner_short, is_unmessagable=unmessagable
376+
)
379377

380378
# TODO: add to export-config and configure
381379
if args.set_canned_message:
@@ -1599,7 +1597,8 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
15991597
)
16001598

16011599
group.add_argument(
1602-
"--set-is-unmessageable", "--set-is-unmessagable", help="Set if a node is messageable or not", action="store"
1600+
"--set-is-unmessageable", "--set-is-unmessagable",
1601+
help="Set if a node is messageable or not", action="store"
16031602
)
16041603

16051604
group.add_argument(

nanopb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 4380dd9e947e6f40e1f31f9eaeda7994ac1872ae

0 commit comments

Comments
 (0)