Compare commits
No commits in common. "5bd592dc1cb8fecfe65afbb3e6fea23382f370c0" and "eb3dc4338f317ccd29771fa028558b9f0df88962" have entirely different histories.
5bd592dc1c
...
eb3dc4338f
2 changed files with 2 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
.venv/
|
|
17
main.py
17
main.py
|
@ -1,9 +1,6 @@
|
||||||
import argparse
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import bluetooth #PyBluez
|
import bluetooth
|
||||||
|
|
||||||
version = '0.0.0'
|
|
||||||
|
|
||||||
def bluetooth_scan():
|
def bluetooth_scan():
|
||||||
print('Discovering Bluetooth Devices...')
|
print('Discovering Bluetooth Devices...')
|
||||||
|
@ -15,17 +12,7 @@ def bluetooth_scan():
|
||||||
print(f'{device[0]}\t{device[1]}')
|
print(f'{device[0]}\t{device[1]}')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argparser = argparse.ArgumentParser(description='CarPI CLI.')
|
bluetooth_scan()
|
||||||
|
|
||||||
# Create actions
|
|
||||||
actions = argparser.add_subparsers(title='actions', required=True)
|
|
||||||
action_list = actions.add_parser('list', help='list nearby bluetooth devices')
|
|
||||||
action_list.set_defaults(func=bluetooth_scan)
|
|
||||||
action_connect = actions.add_parser('connect', help='connect to a bluetooth device')
|
|
||||||
|
|
||||||
args = argparser.parse_args()
|
|
||||||
print(args)
|
|
||||||
args.func()
|
|
||||||
|
|
||||||
if (__name__ == "__main__"):
|
if (__name__ == "__main__"):
|
||||||
sys.exit(main())
|
sys.exit(main())
|
Loading…
Add table
Reference in a new issue