show health and temperature in UI
This commit is contained in:
parent
e5f90a50db
commit
98e2b1ae31
1 changed files with 15 additions and 0 deletions
|
@ -31,6 +31,11 @@ Page {
|
||||||
"empty": qsTr("empty", "Battery fully depleted"),
|
"empty": qsTr("empty", "Battery fully depleted"),
|
||||||
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
"unknown": qsTr("unknown", "Battery not detected, or faulty, or something")
|
||||||
}
|
}
|
||||||
|
property variant healthText: {
|
||||||
|
"good": qsTr("Good", "Battery is OK"),
|
||||||
|
"warm": qsTr("Warm", "Battery is warm"),
|
||||||
|
"overheat": qsTr("Overheated", "Battery is very hot"),
|
||||||
|
}
|
||||||
property bool serviceRunning: true
|
property bool serviceRunning: true
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
@ -166,6 +171,16 @@ Page {
|
||||||
label: qsTr("State:")
|
label: qsTr("State:")
|
||||||
value: statusText[battery.state]
|
value: statusText[battery.state]
|
||||||
}
|
}
|
||||||
|
MyDetailItem {
|
||||||
|
label: qsTr("Health:")
|
||||||
|
value: healthText[battery.health]
|
||||||
|
}
|
||||||
|
MyDetailItem {
|
||||||
|
label: qsTr("Temperature:")
|
||||||
|
// TODO: use weird degrees for US users
|
||||||
|
//value: useImperial ? celsiusToFahrenheit(battery.temperature) + " F" : Math.floor(battery.temperature / 10) + " °C"
|
||||||
|
value: Math.floor(battery.temperature / 10) + " °C"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Column {
|
Column {
|
||||||
|
|
Loading…
Reference in a new issue