From 6fc1e073c02700142fbd682b288fe48ee9934e12 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 24 Nov 2022 10:13:21 +0100 Subject: [PATCH] [bugfix] compared timedelta with int --- parameters.yaml | 4 ++-- survBot.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parameters.yaml b/parameters.yaml index 532a96d..6e7f998 100644 --- a/parameters.yaml +++ b/parameters.yaml @@ -8,7 +8,7 @@ channel_names: ["Temperature (°)", "230V/12V Status (V)", "Router/Charger State stations_blacklist: ["TEST", "EREA"] networks_blacklist: [] interval: 60 # Perform checks every x seconds -n_track: 120 # wait n FAIL intervals before performing an action (i.e. send mail + end highlight status) +n_track: 120 # wait n_track * intervals before performing an action (i.e. send mail/end highlight status) timespan: 7 # Check data of the recent x days verbosity: 0 track_changes: True # tracks all changes since GUI startup by text highlighting (GUI only) @@ -48,7 +48,7 @@ THRESHOLDS: # nw (e.g. 1Y), st (e.g. GR01A), nwst_id (e.g. 1Y.GR01A) # optional! add_links: - slmon: {"URL": "{nw}_{st}.html", "text": "show"} # for example: slmon: {"URL": "{nw}_{st}.html", "text": "link"} + slmon: {"URL": "{nw}_{st}.html", "text": "show"} # for example: slmon: {"URL": "path/{nw}_{st}.html", "text": "link"} # E-mail notifications (optional) EMAIL: diff --git a/survBot.py b/survBot.py index fe70126..a6eeb53 100755 --- a/survBot.py +++ b/survBot.py @@ -637,7 +637,7 @@ class StationQC(object): def check_for_inactive_message(self, key, dt_active): dt_action = self.get_dt_for_action() interval = self.parameters.get('interval') - if dt_action <= dt_active < dt_action + interval: + if dt_action <= dt_active < dt_action + timedelta(seconds=interval): self.send_mail(key, status_type='Inactive') def start(self):