Enhance AlarmClock to skip wakeup actions in non-normal modes and reset actions on alarm time change

This commit is contained in:
Aaro Varis
2026-02-05 10:33:37 +02:00
parent 0a27e41a75
commit c74c3c288a

View File

@@ -126,6 +126,10 @@ class AlarmClock:
"""Check and trigger any wakeup actions that are due"""
if not self.wakeupActions:
return
# if not in normal mode, skip wakeup actions
if self.configMode != "normal":
return
now = datetime.now(ZoneInfo(city.timezone))
today_alarm = now.replace(
@@ -232,6 +236,7 @@ class AlarmClock:
# Increment minute
self.alarmTime = self.alarmTime.replace(minute=(self.alarmTime.minute + 1) % 60)
self.setLcdText(f"Set Min: {self.alarmTime.minute:02d}")
self.resetWakeUpActions() # Reset wakeup actions to apply new alarm time immediately
def onLongPress(self):
"""Handle long button press - cycle through configuration modes"""