feat: 添加 GPIO 电平检测触发亮屏/息屏

新增 GPIOEventDetector 后台线程,以 50ms 间隔轮询 GPIO 引脚。
检测到电平变化时唤醒屏幕并启动 60 秒倒计时,到期无新变化则息屏。

- 添加 GPIOEventDetector 类,支持 RPi.GPIO 硬读取和 Mock 回退
- 集成到 PadSleepApp 主循环,GPIO 触发优先级高于定时亮屏时段
- TUI 状态面板新增 GPIO 行,显示引脚号和倒计时
- 支持通过配置文件调整引脚号(gpio_pin)和倒计时长度
- install.sh 修复:补装 rpi-lgpio 依赖

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kushidou
2026-07-19 16:10:42 +08:00
co-authored by Claude Fable 5
parent da8ad4d17d
commit 9940db451f
6 changed files with 254 additions and 13 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ fi
# ── 安装 Python 依赖 ──
info "正在安装 Python 依赖..."
"$VENV_DIR/bin/pip" install --quiet adbutils 2>&1 || {
"$VENV_DIR/bin/pip" install --quiet adbutils rpi-lgpio 2>&1 || {
warn "pip 安装失败,尝试离线安装..."
if [ -f "$SRC_DIR/.venv" ]; then
cp -r "$SRC_DIR/.venv" "$VENV_DIR"