ratp: Include tramways in alerts
This commit is contained in:
parent
c84449f034
commit
615f2a8652
2
main.py
2
main.py
@ -101,7 +101,7 @@ def main(only_on_coming_evt=False, ignore_module=[], force_coming_event=True, ex
|
|||||||
shape.append(WidgetPlacement(WeeklyWeatherModule, size=(int(480/1.6), 275), position=(480-int(480/1.6), NEXT_STOP_Y + occuped_space + (5 if occuped_space else 0))))
|
shape.append(WidgetPlacement(WeeklyWeatherModule, size=(int(480/1.6), 275), position=(480-int(480/1.6), NEXT_STOP_Y + occuped_space + (5 if occuped_space else 0))))
|
||||||
|
|
||||||
# RATP weather
|
# RATP weather
|
||||||
major_lines = ["M7", "M14", "RB", "T3A"]
|
major_lines = ["M7", "M14", "RB", "TT3A"]
|
||||||
weekday = datetime.now().weekday()
|
weekday = datetime.now().weekday()
|
||||||
if weekday == 0 or weekday == 1 or weekday == 3:
|
if weekday == 0 or weekday == 1 or weekday == 3:
|
||||||
major_lines.append("M1")
|
major_lines.append("M1")
|
||||||
|
@ -77,7 +77,7 @@ class IDFMAPI:
|
|||||||
"MessageType": "SHORT_MESSAGE",
|
"MessageType": "SHORT_MESSAGE",
|
||||||
"MessageText": {
|
"MessageText": {
|
||||||
"id": src["id"],
|
"id": src["id"],
|
||||||
"title": src["title"].replace("Métro " + line + " : ", '').replace("Ligne " + line + " : ", ''),
|
"title": src["title"].replace("Métro " + line + " : ", '').replace("Ligne " + line + " : ", '').replace("Tramway " + line + " : ", ''),
|
||||||
"value": re.sub(cleanr, '', re.sub(cleanrA, '', src["message"].replace(' ', ' ').replace('’', "'").replace('à', 'à').replace('é', 'é').replace('è', 'è').replace('<br>', ' ').replace('</p>', ' ').replace('Information Ile de France Mobilités :', ''))).strip(),
|
"value": re.sub(cleanr, '', re.sub(cleanrA, '', src["message"].replace(' ', ' ').replace('’', "'").replace('à', 'à').replace('é', 'é').replace('è', 'è').replace('<br>', ' ').replace('</p>', ' ').replace('Information Ile de France Mobilités :', ''))).strip(),
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
@ -91,6 +91,7 @@ class IDFMAPI:
|
|||||||
mode = "rers"
|
mode = "rers"
|
||||||
elif mode == "T":
|
elif mode == "T":
|
||||||
mode = "tramways"
|
mode = "tramways"
|
||||||
|
line = line[1:]
|
||||||
elif mode == "B":
|
elif mode == "B":
|
||||||
mode = "buses"
|
mode = "buses"
|
||||||
elif mode == "N":
|
elif mode == "N":
|
||||||
@ -194,7 +195,7 @@ class IDFMAPI:
|
|||||||
draw.rounded_rectangle((0, 0, width, size), radius=4, fill=fill)
|
draw.rounded_rectangle((0, 0, width, size), radius=4, fill=fill)
|
||||||
else:
|
else:
|
||||||
draw.rectangle((0, 0, width, size), fill=fill)
|
draw.rectangle((0, 0, width, size), fill=fill)
|
||||||
draw.text((int(width / 2), int(size / 2)), line, fill="white" if (fill == "black" and mode == "tramways") or (fill != "white" and mode != "tramways") else "black", anchor="mm", font=fnt_icon)
|
draw.text((int(width / 2), int(size / 2)), line, fill="white" if (fill == "black" and mode == "tramways") or (fill != "white" and mode != "tramways") or (fill == "white" and mode == "tramways") else "black", anchor="mm", font=fnt_icon)
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user