Headlines aller 3 Dashboard sind gleich

This commit is contained in:
hubobel 2026-05-31 17:36:58 +02:00
parent b7347f28ca
commit e707e0a71c

107
down.py
View file

@ -441,6 +441,23 @@ def draw_dashboard_1():
font=font_title font=font_title
) )
current_time = time.strftime("%H:%M")
bbox = draw.textbbox(
(0, 0),
current_time,
font=font_title
)
time_width = bbox[2] - bbox[0]
draw.text(
(WIDTH - time_width - 10, 5),
current_time,
fill="white",
font=font_title
)
draw.text( draw.text(
(10, 30), (10, 30),
f"WLAN: {get_ip()}", f"WLAN: {get_ip()}",
@ -557,41 +574,60 @@ def draw_dashboard_2():
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
# Header wie Dashboard 1
draw.text( draw.text(
(20, 20), (10, 5),
"SYSTEMSTATUS", "Hintergasse 9A",
fill="white", fill="white",
font=font_title font=font_title
) )
draw.line( current_time = time.strftime("%H:%M")
(20, 60, WIDTH - 20, 60),
fill="white" bbox = draw.textbbox(
(0, 0),
current_time,
font=font_title
)
time_width = bbox[2] - bbox[0]
draw.text(
(WIDTH - time_width - 10, 5),
current_time,
fill="white",
font=font_title
) )
draw.text( draw.text(
(20, 100), (10, 30),
f"WLAN: {get_ip()}", f"WLAN: {get_ip()}",
fill="cyan", fill="cyan",
font=font_small font=font_small
) )
draw.text( draw.text(
(20, 130), (240, 30),
f"WAN: {get_wan_ip()}", f"WAN: {get_wan_ip()}",
fill="orange", fill="orange",
font=font_small font=font_small_bold
)
draw.line(
(10, 80, WIDTH - 10, 80),
fill="white"
) )
draw.text( draw.text(
(20, 190), (20, 110),
time.strftime("%d.%m.%Y"), time.strftime("%d.%m.%Y"),
fill="white", fill="white",
font=font_small_bold font=font_small_bold
) )
draw.text( draw.text(
(20, 220), (20, 140),
time.strftime("%H:%M:%S"), time.strftime("%H:%M:%S"),
fill="green", fill="green",
font=font_download font=font_download
@ -609,34 +645,69 @@ def draw_dashboard_3():
draw = ImageDraw.Draw(img) draw = ImageDraw.Draw(img)
# Header wie Dashboard 1
draw.text( draw.text(
(20, 20), (10, 5),
"DASHBOARD 3", "Hintergasse 9A",
fill="white", fill="white",
font=font_title font=font_title
) )
draw.line( current_time = time.strftime("%H:%M")
(20, 60, WIDTH - 20, 60),
fill="white" bbox = draw.textbbox(
(0, 0),
current_time,
font=font_title
)
time_width = bbox[2] - bbox[0]
draw.text(
(WIDTH - time_width - 10, 5),
current_time,
fill="white",
font=font_title
) )
draw.text( draw.text(
(20, 100), (10, 30),
f"WLAN: {get_ip()}",
fill="cyan",
font=font_small
)
draw.text(
(240, 30),
f"WAN: {get_wan_ip()}",
fill="orange",
font=font_small_bold
)
draw.line(
(10, 80, WIDTH - 10, 80),
fill="white"
)
# Inhalt Dashboard 3
draw.text(
(20, 110),
"Bereit fuer weitere", "Bereit fuer weitere",
fill="green", fill="green",
font=font_small font=font_small
) )
draw.text( draw.text(
(20, 130), (20, 140),
"Informationen", "Informationen",
fill="green", fill="green",
font=font_small font=font_small
) )
draw.text( draw.text(
(20, 200), (20, 210),
"GPIO21 aktiv", "GPIO21 aktiv",
fill="orange", fill="orange",
font=font_small_bold font=font_small_bold