0.2.0: riscaldamento - obiettivo temperatura casa per zona, stato zone in copertina

This commit is contained in:
Carlo
2026-10-10 07:12:17 +02:00
parent d25da7a91f
commit 7ef9d1e999
10 changed files with 157 additions and 16 deletions
+72 -2
View File
@@ -13,6 +13,10 @@ Page {
// non lo tocca, altrimenti lo slider "salta" a ogni lettura)
property int targetAcs: 55
property bool targetAcsTouched: false
// obiettivo della casa (zona 1); parte dalla temperatura attuale e non
// viene sovrascritto dal refresh finche' l'utente non lo tocca
property real targetCasa: 20
property bool targetCasaTouched: false
property string notice: ""
property bool noticeIsError: false
@@ -73,6 +77,11 @@ Page {
if (v !== undefined && v !== null)
page.targetAcs = Math.round(Number(v))
}
if (!page.targetCasaTouched) {
var c = page.raw("zone1_setpoint")
if (c !== undefined && c !== null && Number(c) > 0)
page.targetCasa = Math.round(Number(c) * 2) / 2
}
}
}
@@ -167,11 +176,72 @@ Page {
font.pixelSize: Theme.fontSizeExtraSmall
}
// ---- riscaldamento: temperatura della casa --------------------- //
SectionHeader { visible: api.configured; text: qsTr("Riscaldamento") }
Label {
visible: api.configured
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Temperatura in casa")
color: Theme.secondaryColor
font.pixelSize: Theme.fontSizeSmall
}
Label {
visible: api.configured
anchors.horizontalCenter: parent.horizontalCenter
text: page.temp("zone1_temperature") + " °C"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeLarge
}
InfoRow {
visible: api.configured
label: qsTr("Obiettivo casa")
value: page.temp("zone1_setpoint") + " °C"
}
InfoRow {
visible: api.configured
label: qsTr("Stato riscaldamento")
value: api.modeLabel(page.raw("zone1_mode"))
}
Slider {
id: casaSlider
visible: api.configured
width: parent.width
label: qsTr("Nuovo obiettivo")
minimumValue: 5
maximumValue: 30
stepSize: 0.5
value: page.targetCasa
valueText: value.toFixed(1) + " °C"
onValueChanged: {
page.targetCasaTouched = true
page.targetCasa = Math.round(value * 2) / 2
}
}
Button {
id: setCasaButton
visible: api.configured
anchors {
left: parent.left
right: parent.right
leftMargin: Theme.horizontalPageMargin
rightMargin: Theme.horizontalPageMargin
}
text: qsTr("Imposta casa a %1 °C").arg(page.targetCasa.toFixed(1))
onClicked: remorse.execute(setCasaButton,
qsTr("Temperatura della casa a %1 °C").arg(page.targetCasa.toFixed(1)),
function() { api.sendCommand("set_heating_setpoint", page.targetCasa) })
}
// ---- stato impianto ------------------------------------------- //
SectionHeader { visible: api.configured; text: qsTr("Impianto") }
InfoRow { visible: api.configured; label: qsTr("Temperatura esterna"); value: page.temp("outdoor_temperature") + " °C" }
InfoRow { visible: api.configured; label: qsTr("Temperatura interna"); value: page.temp("indoor_temperature") + " °C" }
InfoRow { visible: api.configured; label: qsTr("Temperatura interna (pompa)"); value: page.temp("indoor_temperature") + " °C" }
InfoRow { visible: api.configured; label: qsTr("Modalità"); value: api.modeLabel(page.raw("operating_status")) }
InfoRow { visible: api.configured; label: qsTr("Assenza"); value: page.flag("away_mode") }
InfoRow { visible: api.configured; label: qsTr("Night mode"); value: page.flag("night_mode") }
@@ -182,7 +252,7 @@ Page {
InfoRow { visible: api.configured; label: qsTr("Aggiornato alle"); value: page.shortTime(page.raw("pump_updated")) }
// ---- comandi --------------------------------------------------- //
SectionHeader { visible: api.configured; text: qsTr("Comandi") }
SectionHeader { visible: api.configured; text: qsTr("Comandi acqua calda") }
Slider {
visible: api.configured