0.6.0: copertina con pallino di stato, numeri vecchi spenti ed etichetta esterna; catalogo 191/191

This commit is contained in:
2026-10-10 09:55:30 +02:00
parent 5305fab309
commit 75c61cace2
10 changed files with 64 additions and 20 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ python3 tests/ui_contract_check.py http://192.168.3.21:8790
senza telefono)
- **48/48** verifiche offline del bridge (`bridge/test_bridge_commands.py`),
comprese le conversioni Wh→kWh e degli importi delle statistiche
- **190/190** stringhe tradotte nel catalogo italiano: il test carica il `.qm`
- **191/191** stringhe tradotte nel catalogo italiano: il test carica il `.qm`
compilato come fa `main.cpp` e verifica che in inglese l'etichetta di stato sia
la sorgente e in italiano quella tradotta, e che togliendo il catalogo si torni
all'inglese
+1 -1
View File
@@ -149,7 +149,7 @@ Verified so far:
including that a zone command always carries every zone, that absurd values
are refused (40 °C, zone 3, text), and the Wh→kWh / money conversions of the
statistics
- **190/190** strings translated in the Italian catalogue, checked by loading
- **191/191** strings translated in the Italian catalogue, checked by loading
the compiled `.qm` in the test the same way `main.cpp` does: source English
in, Italian out, and back to English when the catalogue is removed
- numbers, amounts and month names formatted through `QLocale`, so the decimal
+6 -1
View File
@@ -275,8 +275,13 @@ si rilegge da solo (2 s): l'aggiornamento automatico, prima, non esisteva.
**Stato breve ed esteso in C++** (`AiraJson::stateShort/stateLong/statusLevel`):
logica pura, verificabile senza SDK e non duplicata fra Home e Impianto. Test
del nucleo: **79/79** (erano 61). Stringhe: **190/190** tradotte. Anteprime
del nucleo: **79/79** (erano 61). Stringhe: **191/191** tradotte. Anteprime
rigenerate (nuova `regolazioni.png`) in italiano e inglese.
**Copertina** (`qml/cover/CoverPage.qml`): pallino di stato come in Home, la
temperatura grande si spegne quando i numeri sono vecchi e l'etichetta finale è
diventata "esterna 18,0 °C" (era "est.", sigla che non diceva niente), con la
riga dei numeri vecchi al posto della temperatura esterna quando serve.
- Nessun comando nuovo all'impianto: anche questa versione resta **sola
lettura** finché non si prova l'invio dal telefono.
+1 -1
View File
@@ -26,7 +26,7 @@ P9, P10 (diagnostica in Impianto), P11.
Rimandato: P8 (azioni sulla copertina), in attesa della prova sul telefono.
Verifiche fatte qui: **79 verifiche del nucleo** (erano 61), `qmllint` pulito su
tutti i file QML, 190/190 stringhe tradotte, anteprime rigenerate in inglese e
tutti i file QML, 191/191 stringhe tradotte, anteprime rigenerate in inglese e
italiano, contratto dei dati fra UI e bridge rispettato
(`tests/ui_contract_check.py`).
Da provare sul telefono: che `TextSwitch` si istanzi davvero, l'altezza reale
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 31 KiB

+41 -9
View File
@@ -11,14 +11,40 @@ CoverBackground {
return api.formatValue(v)
}
Label {
id: titleLabel
// Colore del pallino: gli stessi criteri della Home (vedi MainPage.qml).
// Un dato vecchio e' ambra come un modo attivo: un dato vecchio non e' un
// dato buono, e la copertina e' il posto dove si guarda di sfuggita.
function statusColor() {
if (!api.hasData || api.stale)
return "orange"
var livello = api.statusLevel()
if (livello === 2)
return Theme.errorColor
if (livello === 1)
return Theme.highlightColor
return "#4caf50"
}
Row {
id: intestazione
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Theme.paddingLarge
text: "Aira"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeLarge
spacing: Theme.paddingSmall
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: Theme.paddingSmall
height: width
radius: width / 2
color: cover.statusColor()
}
Label {
text: "Aira"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeLarge
}
}
Column {
@@ -29,8 +55,9 @@ CoverBackground {
Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
// Spenta quando i numeri sono vecchi: non deve sembrare fresca.
color: api.stale ? Theme.secondaryColor : Theme.primaryColor
text: cover.t("zone1_temperature") + " °C"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeHuge
}
@@ -57,8 +84,13 @@ CoverBackground {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingMedium
text: qsTr("outdoor %1 °C").arg(cover.t("outdoor_temperature"))
color: Theme.secondaryColor
// Qui c'e' posto per dire che i numeri non sono freschi.
text: api.stale
? qsTr("Not updated · last %1").arg(api.lastUpdate)
: qsTr("outside %1 °C").arg(cover.t("outdoor_temperature"))
color: api.stale ? "orange" : Theme.secondaryColor
font.pixelSize: Theme.fontSizeExtraSmall
truncationMode: TruncationMode.Fade
width: parent.width - 2 * Theme.paddingMedium
}
}
}
+2
View File
@@ -557,6 +557,8 @@ def cover_screen() -> Image.Image:
card = [96, 430, W - 96, 430 + 470]
d.rounded_rectangle(card, radius=34, fill=(14, 18, 24), outline=ACCENT, width=2)
d.text((card[0] + 34, card[1] + 30), T("app"), font=font(40, bold=True), fill=PRIMARY)
# pallino di stato, come nella copertina vera (verde = tutto regolare)
d.ellipse([card[2] - 56, card[1] + 48, card[2] - 32, card[1] + 72], fill=OK)
d.line([(card[0] + 34, card[1] + 100), (card[2] - 34, card[1] + 100)],
fill=BTN_EDGE, width=2)
y = card[1] + 132
+12 -7
View File
@@ -281,7 +281,7 @@
<message>
<location filename="../qml/pages/CommandsPage.qml" line="75"/>
<source>Lowers the house and stops the hot water</source>
<translation>Abbassa la casa e spegne l'acqua calda</translation>
<translation>Abbassa la casa e spegne l&apos;acqua calda</translation>
</message>
<message>
<location filename="../qml/pages/CommandsPage.qml" line="88"/>
@@ -306,7 +306,7 @@
<message>
<location filename="../qml/pages/CommandsPage.qml" line="121"/>
<source>The heat pump keeps the water in temperature</source>
<translation>Mantiene l'acqua in temperatura</translation>
<translation>Mantiene l&apos;acqua in temperatura</translation>
</message>
<message>
<location filename="../qml/pages/CommandsPage.qml" line="135"/>
@@ -337,19 +337,24 @@
<context>
<name>CoverPage</name>
<message>
<location filename="../qml/cover/CoverPage.qml" line="40"/>
<location filename="../qml/cover/CoverPage.qml" line="67"/>
<source>house · target %1 °C</source>
<translation>casa · obiettivo %1 °C</translation>
</message>
<message>
<location filename="../qml/cover/CoverPage.qml" line="49"/>
<location filename="../qml/cover/CoverPage.qml" line="76"/>
<source>DHW %1 °C · target %2 °C</source>
<translation>ACS %1 °C · obiettivo %2 °C</translation>
</message>
<message>
<location filename="../qml/cover/CoverPage.qml" line="60"/>
<source>outdoor %1 °C</source>
<translation>est. %1 °C</translation>
<location filename="../qml/cover/CoverPage.qml" line="89"/>
<source>Not updated · last %1</source>
<translation>Non aggiornato · ultimo %1</translation>
</message>
<message>
<location filename="../qml/cover/CoverPage.qml" line="90"/>
<source>outside %1 °C</source>
<translation>esterna %1 °C</translation>
</message>
</context>
<context>