fix: only reset alerts when door state is 'closed'

Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
2025-08-01 20:51:17 +00:00
parent bb1da6d836
commit 13ef45f72a

View File

@@ -190,7 +190,7 @@ async def monitor_state_transitions(app):
if open_duration_minutes >= threshold and threshold not in OPEN_ALERTS_SENT_FOR_CURRENT_OPENING:
logging.info(f"ALERT: Garage door has been open for {threshold} minutes.")
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING.append(threshold)
else:
elif current_state == 'closed':
DOOR_OPEN_START_TIME = None
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING = []