Implement GPIO button hold detection and LED feedback (story 4-1)

Replace stub ButtonHoldDetector and LEDController with real gpiozero
implementations; update tests to use MockFactory so they run without
physical GPIO hardware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Edholm
2026-04-22 23:55:42 -04:00
parent ddde3358ef
commit 66884270a8
4 changed files with 102 additions and 5 deletions
+21 -3
View File
@@ -1,11 +1,29 @@
import logging
from gpiozero import LED, Button
from planemapper.constants import RESET_HOLD_S
log = logging.getLogger(__name__)
BUTTON_GPIO_PIN = 17
LED_GPIO_PIN = 27
class ButtonHoldDetector:
def __init__(self, pin: int = BUTTON_GPIO_PIN) -> None:
self._button = Button(pin, hold_time=RESET_HOLD_S)
def check(self) -> bool:
return False
return self._button.is_held
class LEDController:
def __init__(self, pin: int = LED_GPIO_PIN) -> None:
self._led = LED(pin)
def on(self) -> None:
pass
self._led.on()
def off(self) -> None:
pass
self._led.off()