@@ -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 :
342+ if args .set_owner or args .set_owner_short or args . set_is_unmessageable :
343343 closeNow = True
344344 waitForAckNak = True
345345
@@ -358,9 +358,22 @@ def onConnected(interface):
358358 print (f"Setting device owner to { args .set_owner } and short name to { args .set_owner_short } " )
359359 elif args .set_owner :
360360 print (f"Setting device owner to { args .set_owner } " )
361- else : # short name only
361+ elif args . set_owner_short and not args . set_owner :
362362 print (f"Setting device owner short to { args .set_owner_short } " )
363- interface .getNode (args .dest , False , ** getNode_kwargs ).setOwner (long_name = args .set_owner , short_name = args .set_owner_short )
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+ )
364377
365378 # TODO: add to export-config and configure
366379 if args .set_canned_message :
@@ -1595,6 +1608,11 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
15951608 "--set-ham" , help = "Set licensed Ham ID and turn off encryption" , action = "store"
15961609 )
15971610
1611+ group .add_argument (
1612+ "--set-is-unmessageable" , "--set-is-unmessagable" ,
1613+ help = "Set if a node is messageable or not" , action = "store"
1614+ )
1615+
15981616 group .add_argument (
15991617 "--ch-set-url" , "--seturl" ,
16001618 help = "Set all channels and set LoRa config from a supplied URL" ,
0 commit comments