diff --git a/.coveragerc b/.coveragerc index 5171a00..c9d62bb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = meshtastic/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py +omit = meshtastic/protobuf/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py [report] exclude_lines = diff --git a/bin/regen-protobufs.sh b/bin/regen-protobufs.sh index a41f7ba..4a3d179 100755 --- a/bin/regen-protobufs.sh +++ b/bin/regen-protobufs.sh @@ -15,7 +15,7 @@ echo "Fixing up protobuf paths in ${TMPDIR} temp directory" # Ensure a clean build -rm -r "${TMPDIR}" +[ -e "${TMPDIR}" ] && rm -r "${TMPDIR}" INDIR=${TMPDIR}/in/meshtastic/protobuf OUTDIR=${TMPDIR}/out diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 73be10c..9498415 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -1089,7 +1089,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( @@ -1159,14 +1159,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