diff --git a/rattail_tempmon/server.py b/rattail_tempmon/server.py index a5d913c..62a1068 100644 --- a/rattail_tempmon/server.py +++ b/rattail_tempmon/server.py @@ -116,13 +116,14 @@ class TempmonServerDaemon(Daemon): } prev_status = probe.status + prev_alert_sent = probe.status_alert_sent if probe.status != status: probe.status = status probe.status_changed = self.now probe.status_alert_sent = None # send email when things go back to normal, after being bad - if status == self.enum.TEMPMON_PROBE_STATUS_GOOD_TEMP: + if status == self.enum.TEMPMON_PROBE_STATUS_GOOD_TEMP and prev_alert_sent: send_email(self.config, 'tempmon_good_temp', data) probe.status_alert_sent = self.now