From 3844aa9d6a0b9a034c862265a2e87c3acd8db90b Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 14 Mar 2026 02:41:07 +1300 Subject: [PATCH] Add numeric device ID option Allow setting ESPNow device id from CLI and persist to settings. Made-with: Cursor --- cli.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cli.py b/cli.py index 2514618..1a13d4a 100755 --- a/cli.py +++ b/cli.py @@ -243,6 +243,14 @@ Examples: help="Device name" ) + parser.add_argument( + "--id", + dest="device_id", + type=int, + metavar="0-255", + help="Numeric device ID used for ESPNow (0-255)" + ) + parser.add_argument( "--pin", type=int, @@ -499,6 +507,10 @@ Examples: if args.default is not None: edits["default"] = args.default + if args.device_id is not None: + # Clamp into single-byte range; store as int in settings.json + edits["id"] = max(0, min(255, args.device_id)) + # 1. Download: get current settings from device try: print(f"Downloading settings from {args.port}...", file=sys.stderr)