From 440d1cbc636b00903c9d0176d9ca33fe0a10c69e Mon Sep 17 00:00:00 2001 From: Shane Jordan Date: Fri, 27 Mar 2026 17:28:12 -0500 Subject: [PATCH 1/2] feat: add keypad and Moonraker URL prompts to installer - Optional Hardware section: adds "3x4 matrix keypad attached?" prompt - Printer Integration section: asks if Klipper/Moonraker, prompts for URL - NVS CSV: writes keypad_on and moonraker_url to NVS partition - nvs_keys.csv: documents both new keys --- install.py | 11 +++++++++++ nvs_keys.csv | 2 ++ 2 files changed, 13 insertions(+) diff --git a/install.py b/install.py index e52fe15..663c083 100755 --- a/install.py +++ b/install.py @@ -246,6 +246,13 @@ def collect_scanner_config() -> Dict[str, Union[str, int]]: print(f"\n{C.CYAN}── Optional Hardware ──────────────────{C.RESET}\n") lcd_on = ask_yesno("16x2 I2C LCD display attached?", default=False) led_on = ask_yesno("Status LED attached?", default=True) + keypad_on = ask_yesno("3x4 matrix keypad attached?", default=False) + + print(f"\n{C.CYAN}── Printer Integration ────────────────{C.RESET}\n") + moonraker_url = "" + if ask_yesno("Klipper / Moonraker printer?", default=False): + moonraker_url = ask("Moonraker URL", default="http://localhost:7125", + validate=validate_url) return { "board": board, @@ -261,6 +268,8 @@ def collect_scanner_config() -> Dict[str, Union[str, int]]: "auto_mode": int(auto_mode), "lcd_on": 1 if lcd_on else 0, "led_on": 1 if led_on else 0, + "keypad_on": 1 if keypad_on else 0, + "moonraker_url": moonraker_url, } @@ -347,6 +356,8 @@ def generate_nvs_csv(config: Dict[str, Union[str, int]]) -> str: f"auto_mode,data,u8,{config['auto_mode']}", f"lcd_on,data,u8,{config['lcd_on']}", f"led_on,data,u8,{config['led_on']}", + f"keypad_on,data,u8,{config['keypad_on']}", + f"moonraker_url,data,string,{config['moonraker_url']}", ] return "\n".join(lines) + "\n" diff --git a/nvs_keys.csv b/nvs_keys.csv index cb8356c..4b2bf5d 100644 --- a/nvs_keys.csv +++ b/nvs_keys.csv @@ -12,3 +12,5 @@ spoolman_url,data,string,Spoolman base URL auto_mode,data,u8,Automation mode: 0=Self Directed 1=Controlled by HA lcd_on,data,u8,LCD display enabled (1) or disabled (0) led_on,data,u8,Status LED enabled (1) or disabled (0) +keypad_on,data,u8,3x4 matrix keypad enabled (1) or disabled (0) +moonraker_url,data,string,Moonraker URL for Klipper integration (e.g. http://192.168.1.72:7125) From de774285b8c1e99aebe07f57c5278830371bb4c8 Mon Sep 17 00:00:00 2001 From: Shane Jordan Date: Fri, 27 Mar 2026 17:41:55 -0500 Subject: [PATCH 2/2] fix: correct indentation of instructions block in coderabbit config --- .coderabbit.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index d7efe57..2b75fc1 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -12,14 +12,14 @@ reviews: base_branches: - ".*" instructions: | - Python CLI installer for SpoolSense (scanner firmware + middleware). - Single-file script (install.py) that runs on Raspberry Pi and laptops. + Python CLI installer for SpoolSense (scanner firmware + middleware). + Single-file script (install.py) that runs on Raspberry Pi and laptops. - ## Project-specific rules + ## Project-specific rules - - All functions must have type hints and docstrings - - User input must be validated before use (validate_* functions) - - Passwords must use getpass, never plain input() - - All external commands (esptool, git, pip) must handle FileNotFoundError - - sys.exit() calls must have user-friendly error messages, not raw tracebacks - - Support Linux (Pi), macOS, and Windows where possible + - All functions must have type hints and docstrings + - User input must be validated before use (validate_* functions) + - Passwords must use getpass, never plain input() + - All external commands (esptool, git, pip) must handle FileNotFoundError + - sys.exit() calls must have user-friendly error messages, not raw tracebacks + - Support Linux (Pi), macOS, and Windows where possible