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:
@@ -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:
|
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.")
|
logging.info(f"ALERT: Garage door has been open for {threshold} minutes.")
|
||||||
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING.append(threshold)
|
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING.append(threshold)
|
||||||
else:
|
elif current_state == 'closed':
|
||||||
DOOR_OPEN_START_TIME = None
|
DOOR_OPEN_START_TIME = None
|
||||||
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING = []
|
OPEN_ALERTS_SENT_FOR_CURRENT_OPENING = []
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user