Skip to content

Commit

Permalink
Restrict range
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Jul 1, 2024
1 parent 2f4276e commit 6d11883
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/2mic_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ async def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--uri", required=True, help="unix:// or tcp://")
parser.add_argument("--debug", action="store_true", help="Log DEBUG messages")
parser.add_argument("--led-brightness", type=int, default=31, help="LED brightness (integer from 1 to 31)")
parser.add_argument(
"--led-brightness",
type=int,
choices=range(1, 32),
default=31,
help="LED brightness (integer from 1 to 31)",
)
args = parser.parse_args()

logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)
Expand Down

0 comments on commit 6d11883

Please sign in to comment.