mirror of
https://codeberg.org/privacy1st/de-p1st-monitor
synced 2024-11-23 19:49:32 +01:00
don't warn if value stayed the same
This commit is contained in:
parent
34a66cd098
commit
f93329a67b
@ -102,12 +102,12 @@ class Logger(ABC):
|
|||||||
previous_warn_datas = warn_datas[-self.warn_data_range - 1:-1]
|
previous_warn_datas = warn_datas[-self.warn_data_range - 1:-1]
|
||||||
prev_num_warnings, prev_highest_warning = self._get_num_warnings(previous_warn_datas)
|
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:
|
if prev_num_warnings >= self.warn_if_above:
|
||||||
previous_warn_data = warn_datas[-2]
|
previous_warn_data = warn_datas[-2]
|
||||||
if isinstance(current_warn_data, WarnData) \
|
if isinstance(current_warn_data, WarnData) \
|
||||||
and isinstance(previous_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)
|
return WarnMessage(WarnLevel.NONE)
|
||||||
|
|
||||||
# Send warning.
|
# Send warning.
|
||||||
|
Loading…
Reference in New Issue
Block a user