From b334376ea03443c844ee3042bd93411ba8b4ec4f Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 27 Jul 2024 10:57:22 +0200 Subject: [PATCH 1/2] ratp: Display M14 trains 5 minutes ahead --- modules/ratp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ratp.py b/modules/ratp.py index ba8dd15..b692355 100644 --- a/modules/ratp.py +++ b/modules/ratp.py @@ -483,13 +483,17 @@ class RATPNextStopModule: align = 0 - mint = datetime.now() + timedelta(minutes=10) - api = IDFMAPI(config) for stop in stops: tmp = stop.split("/", 2) mode = tmp[0][0] line = tmp[0][1:] + + if tmp[0] == "M14": + mint = datetime.now() + timedelta(minutes=4) + else: + mint = datetime.now() + timedelta(minutes=10) + try: if 1 < len(tmp) < 4: prep = {} From f7f97595f2d463c5a5ab2e577776af8fb3ce7aa5 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 27 Jul 2024 10:57:40 +0200 Subject: [PATCH 2/2] ratp: Center one line icons --- modules/ratp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ratp.py b/modules/ratp.py index b692355..ceff3f6 100644 --- a/modules/ratp.py +++ b/modules/ratp.py @@ -511,7 +511,7 @@ class RATPNextStopModule: prep[s["destination"]].append(s) icon = IDFMAPI.get_line_icon(config, mode, line, int(line_height*(1.5 if len(prep.keys()) > 1 else 1))) - image.paste(icon, (0, align), icon) + image.paste(icon, (0 if len(prep.keys()) > 1 else int(line_height * 1.5 / 2 - icon.width / 2), align), icon) max_dest = 64 for dest, msgs in prep.items():