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 self._button.is_held class LEDController: def __init__(self, pin: int = LED_GPIO_PIN) -> None: self._led = LED(pin) def on(self) -> None: self._led.on() def off(self) -> None: self._led.off()