Improve alerts

This commit is contained in:
nemunaire 2022-08-14 18:51:03 +02:00
parent 6b7e277f84
commit bcd130dc06

View File

@ -104,8 +104,10 @@ class IDFMAPI:
if mode == "metros":
draw.ellipse((0, 0, width, size), fill=fill)
elif mode == "tramways":
draw.rectangle((0, 0, width, 1), fill=fill)
draw.rectangle((0, size-2, width, size), fill=fill)
if fill == "black":
draw.rectangle((0, 0, width, size), fill=fill)
draw.rectangle((0, 0, width, 1), fill=fill if fill != "black" else "gray")
draw.rectangle((0, size-2, width, size), fill=fill if fill != "black" else "gray")
else:
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)
@ -151,7 +153,7 @@ class RATPWeatherModule:
continue
yield {
"description": msg["MessageText"]["value"],
"description": msg["MessageText"]["value"].replace("", ""),
"icon": alert_icon(mode, line),
}