blatted/blatted/cli/__init__.py

30 lines
482 B
Python
Raw Normal View History

2023-05-13 13:31:49 +02:00
import click
from ..tools import context
from ..tools.ble import monitor, scanner
2023-05-13 13:31:49 +02:00
2023-05-16 23:07:58 +02:00
@click.command(name="scan")
def scanner_cmd() -> None:
2023-05-13 14:32:15 +02:00
scanner.run()
2023-05-13 13:31:49 +02:00
2023-05-16 23:07:58 +02:00
@click.command(name="monitor")
def monitor_cmd() -> None:
2023-05-16 23:07:58 +02:00
monitor.run()
@click.command(name="tui")
def tui_cmd() -> None:
2023-05-13 13:31:49 +02:00
pass
@click.group()
def main() -> None:
context.set_environment(context.BlattedEnvironment.CLI)
2023-05-16 23:07:58 +02:00
main.add_command(scanner_cmd)
main.add_command(monitor_cmd)
main.add_command(tui_cmd)