From 8e57f2d927a9a1e9525d6afb640f1f6b6070ac79 Mon Sep 17 00:00:00 2001 From: Matt Edholm Date: Wed, 22 Apr 2026 23:56:20 -0400 Subject: [PATCH] Mark story 4-1 done, add deferred items from review Review passed all criteria; update sprint-status to done, close the story file, and record two deferred items (GPIO pins into constants.py, ButtonHoldDetector init-time GPIO dependency) in deferred-work.md. Co-Authored-By: Claude Sonnet 4.6 --- ...-gpio-button-hold-detection-and-led-feedback.md | 2 +- .../implementation-artifacts/deferred-work.md | 14 ++++++++++++++ .../implementation-artifacts/sprint-status.yaml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/_bmad-output/implementation-artifacts/4-1-gpio-button-hold-detection-and-led-feedback.md b/_bmad-output/implementation-artifacts/4-1-gpio-button-hold-detection-and-led-feedback.md index bfe453c..560cc2f 100644 --- a/_bmad-output/implementation-artifacts/4-1-gpio-button-hold-detection-and-led-feedback.md +++ b/_bmad-output/implementation-artifacts/4-1-gpio-button-hold-detection-and-led-feedback.md @@ -1,6 +1,6 @@ # Story 4.1: GPIO Button Hold Detection & LED Feedback -Status: review +Status: done ## Story diff --git a/_bmad-output/implementation-artifacts/deferred-work.md b/_bmad-output/implementation-artifacts/deferred-work.md index 3bdffb4..f1ccd2d 100644 --- a/_bmad-output/implementation-artifacts/deferred-work.md +++ b/_bmad-output/implementation-artifacts/deferred-work.md @@ -200,3 +200,17 @@ Description: `time.sleep(REFRESH_INTERVAL_S)` is a dumb fixed sleep appended aft Story: `2-7-operational-radar-loop-startup-screen-and-systemd-wiring` Category: Technical debt Description: The startup screen text is drawn at `DISPLAY_WIDTH // 2 - 60, DISPLAY_HEIGHT // 2` (i.e. x=340). The offset of −60 is a pixel-counted approximation, not derived from actual font metrics. Depending on the Pillow version and the default font's rendered width, the text may appear left-biased. Future hardening: use `ImageDraw.textlength()` (Pillow ≥9.2) to compute the real string width and centre precisely. + +--- + +## Story 4.1: GPIO Button Hold Detection & LED Feedback + +### [4-1] GPIO pin numbers belong in constants.py +Story: `4-1-gpio-button-hold-detection-and-led-feedback` +Category: Technical debt +Description: `BUTTON_GPIO_PIN = 17` and `LED_GPIO_PIN = 27` are module-level constants in `gpio_ctrl.py`. For production tuning and hardware revision they belong in `constants.py` alongside other hardware-facing constants. Future hardening: move both to `constants.py` and import them into `gpio_ctrl.py` from there. + +### [4-1] ButtonHoldDetector instantiates real gpiozero.Button at __init__ +Story: `4-1-gpio-button-hold-detection-and-led-feedback` +Category: Infrastructure/environment +Description: `ButtonHoldDetector.__init__` constructs a `gpiozero.Button` immediately. The radar main loop must construct `ButtonHoldDetector` at startup (not at import time), or the application will fail if GPIO is unavailable when the module is imported. This is currently safe because `gpio_ctrl.py` is not imported at module level in `main.py`, but any future reorganisation that imports it at the top of a module that runs on non-GPIO hardware will raise a `BadPinFactory` error unless a `MockFactory` is active. diff --git a/_bmad-output/implementation-artifacts/sprint-status.yaml b/_bmad-output/implementation-artifacts/sprint-status.yaml index 414f47f..ab5e9bc 100644 --- a/_bmad-output/implementation-artifacts/sprint-status.yaml +++ b/_bmad-output/implementation-artifacts/sprint-status.yaml @@ -70,6 +70,6 @@ development_status: # Epic 4: Reset & Reconfiguration epic-4: in-progress - 4-1-gpio-button-hold-detection-and-led-feedback: review + 4-1-gpio-button-hold-detection-and-led-feedback: done 4-2-config-wipe-setup-screen-and-return-to-provisioning: backlog epic-4-retrospective: optional