0.2.0: riscaldamento - obiettivo temperatura casa per zona, stato zone in copertina
This commit is contained in:
+26
-10
@@ -87,8 +87,9 @@ def progress(d: ImageDraw.ImageDraw, y: int, frac: float) -> None:
|
||||
d.rounded_rectangle([M, y, end, y + 3], radius=2, fill=ACCENT)
|
||||
|
||||
|
||||
def slider(d: ImageDraw.ImageDraw, y: int, frac: float, value_text: str) -> int:
|
||||
d.text((M, y), "Obiettivo ACS", font=font(24), fill=SECONDARY)
|
||||
def slider(d: ImageDraw.ImageDraw, y: int, frac: float, value_text: str,
|
||||
label: str = "Obiettivo ACS") -> int:
|
||||
d.text((M, y), label, font=font(24), fill=SECONDARY)
|
||||
vw = d.textlength(value_text, font=font(24))
|
||||
d.text((W - M - vw, y), value_text, font=font(24), fill=PRIMARY)
|
||||
ty = y + 58
|
||||
@@ -129,15 +130,27 @@ def main_screen() -> Image.Image:
|
||||
t = "obiettivo 55,0 °C"
|
||||
d.text(((W - d.textlength(t, font=font(24))) / 2, y), t, font=font(24), fill=SECONDARY)
|
||||
|
||||
y = section_header(d, y + 44, "Impianto")
|
||||
y = label_pair(d, y, "Esterna", "18,0 °C")
|
||||
y = label_pair(d, y, "Interna", "22,5 °C")
|
||||
y = label_pair(d, y, "Modalità", "Auto")
|
||||
y = label_pair(d, y, "Zone", "1")
|
||||
y = label_pair(d, y, "Errori", "0")
|
||||
y = label_pair(d, y, "Aggiornato", "19:07")
|
||||
# ---- 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 = button(d, y, "Imposta casa a 19,0 °C", primary=True)
|
||||
|
||||
y = section_header(d, y + 24, "Comandi")
|
||||
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")
|
||||
y = button(d, y, "Imposta obiettivo ACS", primary=True)
|
||||
y = button(d, y, "Avvia boost ACS")
|
||||
@@ -202,6 +215,9 @@ def cover_screen() -> Image.Image:
|
||||
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)
|
||||
return img
|
||||
|
||||
|
||||
Reference in New Issue
Block a user