From f93329a67b49a4edfd8550d3c3065d4a2c60aa35 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 15 Aug 2024 17:20:41 +0200 Subject: [PATCH] don't warn if value stayed the same --- src/de/p1st/monitor/logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/p1st/monitor/logger.py b/src/de/p1st/monitor/logger.py index dc8bd1b..86b5f25 100644 --- a/src/de/p1st/monitor/logger.py +++ b/src/de/p1st/monitor/logger.py @@ -102,12 +102,12 @@ class Logger(ABC): previous_warn_datas = warn_datas[-self.warn_data_range - 1:-1] prev_num_warnings, prev_highest_warning = self._get_num_warnings(previous_warn_datas) - # Don't send warning again if the current value decreased. + # Don't send warning again if the current value decreased or stayed the same. if prev_num_warnings >= self.warn_if_above: previous_warn_data = warn_datas[-2] if isinstance(current_warn_data, WarnData) \ and isinstance(previous_warn_data, WarnData) \ - and current_warn_data.value <= previous_warn_data.value: + and current_warn_data.value < previous_warn_data.value: return WarnMessage(WarnLevel.NONE) # Send warning.