Fix power button screen toggle instantly turning back on

Power button events were setting any_activity before the power handler's
continue, causing the generic wake logic to immediately re-enable the screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Smith
2026-02-13 23:18:42 +01:00
parent f9fcb9f121
commit 1ea1490e60
2 changed files with 6 additions and 2 deletions

View File

@@ -198,8 +198,6 @@ def main():
if ev_type == EV_SYN:
continue
any_activity = True
# Power button handling (EV_KEY only)
if ev_type == EV_KEY and ev_code == KEY_POWER:
if ev_value == 1: # press
@@ -220,6 +218,8 @@ def main():
# Between SHORT and LONG threshold: ignore (release before 3s)
continue
any_activity = True
# Any input activity resets idle shutdown timer
if any_activity:
last_active_time = time.monotonic()