From 719b68e737de3a2f4e7da6c5dee8e96acd50ce33 Mon Sep 17 00:00:00 2001 From: Mason10198 <31994327+Mason10198@users.noreply.github.com> Date: Fri, 21 Jul 2023 09:35:05 -0500 Subject: [PATCH] Detect manual execution; provide feedback --- SkywarnPlus.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SkywarnPlus.py b/SkywarnPlus.py index a6b7b13..82e998b 100644 --- a/SkywarnPlus.py +++ b/SkywarnPlus.py @@ -39,6 +39,7 @@ import time import wave import contextlib import math +import sys from datetime import datetime, timezone, timedelta from dateutil import parser from pydub import AudioSegment @@ -1140,7 +1141,13 @@ def main(): logger.debug("Sending pushover notification: %s", pushover_message) sendPushover(pushover_message, title="Alerts Changed") else: - logger.debug("No change in alerts") + if sys.stdin.isatty(): + # list of current alerts, unless there arent any, then current_alerts = "None" + current_alerts = ("None" if len(alerts) == 0 else ", ".join(alerts.keys())) + logger.info("No change in alerts.") + logger.info("Current alerts: %s.", current_alerts) + else: + logger.debug("No change in alerts.") if __name__ == "__main__":