mirror of
https://github.com/meshtastic/python.git
synced 2026-01-12 17:57:58 -05:00
nargs='?' is awesome! get rid of ble_dest.
This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -10,7 +10,7 @@
|
||||
"request": "launch",
|
||||
"module": "meshtastic",
|
||||
"justMyCode": false,
|
||||
"args": ["--ble", "--ble-dest", "Meshtastic_9f6e"]
|
||||
"args": ["--ble", "Meshtastic_9f6e"]
|
||||
},
|
||||
{
|
||||
"name": "meshtastic BLE scan",
|
||||
|
||||
@@ -1046,7 +1046,7 @@ def common():
|
||||
print(f"Found: name='{x.name}' address='{x.address}'")
|
||||
meshtastic.util.our_exit("BLE scan finished", 0)
|
||||
elif args.ble:
|
||||
client = BLEInterface(args.ble_dest, debugOut=logfile, noProto=args.noproto, noNodes=args.no_nodes)
|
||||
client = BLEInterface(args.ble if args.ble != "any" else None, debugOut=logfile, noProto=args.noproto, noNodes=args.no_nodes)
|
||||
elif args.host:
|
||||
try:
|
||||
client = meshtastic.tcp_interface.TCPInterface(
|
||||
@@ -1114,14 +1114,10 @@ def addConnectionArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParse
|
||||
|
||||
group.add_argument(
|
||||
"--ble",
|
||||
help="The BLE device address or name to connect to",
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
outer.add_argument(
|
||||
"--ble-dest",
|
||||
help="The BLE device address or name to connect to",
|
||||
help="Connect to a BLE device, optionally specifying a device name (defaults to 'any')",
|
||||
nargs="?",
|
||||
default=None,
|
||||
const="any"
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
Reference in New Issue
Block a user