0.2.1: temperatura della casa in cima alla home, acqua calda in sezione dedicata

This commit is contained in:
Carlo
2026-10-10 07:14:57 +02:00
parent 8f0f129fd5
commit 2f6c939603
8 changed files with 94 additions and 100 deletions
+26 -32
View File
@@ -118,44 +118,41 @@ def main_screen() -> Image.Image:
page_header(d, "Aira")
y = 156
c = "Acqua calda"
d.text(((W - d.textlength(c, font=font(26))) / 2, y), c, font=font(26), fill=SECONDARY)
# ---- casa: il dato principale, in cima ------------------------------- #
c = "Temperatura in casa"
d.text(((W - d.textlength(c, font=font(24))) / 2, y), c, font=font(24), fill=SECONDARY)
y += 40
big = "51,0 °C"
big = "23,0 °C"
d.text(((W - d.textlength(big, font=font(92, bold=True))) / 2, y),
big, font=font(92, bold=True), fill=PRIMARY)
y += 116
progress(d, y, (51.0 - 20) / (65 - 20))
progress(d, y, (23.0 - 5) / (30 - 5))
y += 22
t = "obiettivo 55,0 °C"
t = "obiettivo 19,0 °C · Riscaldamento"
d.text(((W - d.textlength(t, font=font(24))) / 2, y), t, font=font(24), fill=SECONDARY)
# ---- riscaldamento: temperatura della casa -------------------------- #
y = section_header(d, y + 44, "Riscaldamento")
c = "Temperatura in casa"
d.text(((W - d.textlength(c, font=font(24))) / 2, y), c, font=font(24), fill=SECONDARY)
y += 34
big2 = "23,0 °C"
d.text(((W - d.textlength(big2, font=font(64, bold=True))) / 2, y),
big2, font=font(64, bold=True), fill=PRIMARY)
y += 88
y = label_pair(d, y, "Obiettivo casa", "19,0 °C")
y = label_pair(d, y, "Stato riscaldamento", "Riscaldamento")
y = slider(d, y + 14, (19.0 - 5) / (30 - 5), "19,0 °C", "Nuovo obiettivo")
y += 46
y = slider(d, y, (19.0 - 5) / (30 - 5), "19,0 °C", "Nuovo obiettivo casa")
y = button(d, y, "Imposta casa a 19,0 °C", primary=True)
y = section_header(d, y + 24, "Impianto")
y = label_pair(d, y, "Esterna", "18,0 °C")
y = label_pair(d, y, "Interna (pompa)", "22,5 °C")
y = label_pair(d, y, "Modalità", "Automatico")
y = label_pair(d, y, "Errori", "0")
y = section_header(d, y + 24, "Comandi acqua calda")
y = slider(d, y, (55.0 - 45) / (60 - 45), "55 °C")
# ---- acqua calda sanitaria ------------------------------------------- #
y = section_header(d, y + 24, "Acqua calda sanitaria")
acs = "51,0 °C"
d.text(((W - d.textlength(acs, font=font(56, bold=True))) / 2, y),
acs, font=font(56, bold=True), fill=PRIMARY)
y += 76
progress(d, y, (51.0 - 20) / (65 - 20))
y += 22
y = label_pair(d, y, "Obiettivo acqua calda", "55,0 °C")
y = slider(d, y + 10, (55.0 - 45) / (60 - 45), "55 °C")
y = button(d, y, "Imposta obiettivo ACS", primary=True)
y = button(d, y, "Avvia boost ACS")
y = button(d, y, "Ferma boost ACS")
# ---- stato impianto (scorre sotto) ----------------------------------- #
y = section_header(d, y + 24, "Impianto")
y = label_pair(d, y, "Esterna", "18,0 °C")
y = label_pair(d, y, "Interna (pompa)", "22,5 °C")
d.text(((W - d.textlength("Trascina verso il basso per aggiornare",
font=font(22))) / 2, y + 8),
"Trascina verso il basso per aggiornare", font=font(22), fill=SECONDARY)
@@ -206,19 +203,16 @@ def cover_screen() -> Image.Image:
d.line([(card[0] + 34, card[1] + 100), (card[2] - 34, card[1] + 100)],
fill=BTN_EDGE, width=2)
y = card[1] + 132
big = "51,0 °C"
big = "23,0 °C"
d.text(((W - d.textlength(big, font=font(76, bold=True))) / 2, y),
big, font=font(76, bold=True), fill=PRIMARY)
y += 108
for lab, val in (("obiettivo", "55,0 °C"), ("esterna", "18,0 °C")):
for lab, val in (("obiettivo", "19,0 °C"), ("ACS", "51,0 °C"), ("esterna", "18,0 °C")):
d.text((card[0] + 34, y), lab, font=font(24), fill=SECONDARY)
vw = d.textlength(val, font=font(24))
d.text((card[2] - 34 - vw, y), val, font=font(24), fill=PRIMARY)
y += 52
vw = d.textlength("23,0 °C", font=font(24))
d.text((card[0] + 34, y), "casa", font=font(24), fill=SECONDARY)
d.text((card[2] - 34 - vw, y), "23,0 °C", font=font(24), fill=PRIMARY)
d.text((card[0] + 34, card[3] - 60), "acqua calda sanitaria", font=font(22), fill=SECONDARY)
d.text((card[0] + 34, card[3] - 60), "temperatura in casa", font=font(22), fill=SECONDARY)
return img