From a5282f51793face92b59b90b62514370be1eba96 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 22 Aug 2022 09:28:41 +0200 Subject: [PATCH] ical: Can configure delayed departure --- modules/ical.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ical.py b/modules/ical.py index c6868c6..5c07a1a 100644 --- a/modules/ical.py +++ b/modules/ical.py @@ -15,6 +15,8 @@ class IcalModule: def __init__(self, config): self.cals = config.cals + self.delayed_departure = 100 + self._cached_file = ".ical-%s.cache" self.cache_time = 15 @@ -162,7 +164,7 @@ class IcalModule: def event_coming(self, config): now = datetime.now(tz=pytz.timezone('Europe/Paris')) - coming = datetime.now(tz=pytz.timezone('Europe/Paris')) + timedelta(minutes=80) + coming = datetime.now(tz=pytz.timezone('Europe/Paris')) + timedelta(minutes=self.delayed_departure) for evt in self.get_events(config): # Looking only the first event