From 98e2b1ae3192172cdf6ad8a461aad082605c2564 Mon Sep 17 00:00:00 2001 From: "Peter G. (nephros)" Date: Sun, 2 May 2021 10:23:58 +0200 Subject: [PATCH] show health and temperature in UI --- application/qml/pages/MainPage.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/qml/pages/MainPage.qml b/application/qml/pages/MainPage.qml index d6cf582..d60147a 100644 --- a/application/qml/pages/MainPage.qml +++ b/application/qml/pages/MainPage.qml @@ -31,6 +31,11 @@ Page { "empty": qsTr("empty", "Battery fully depleted"), "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 Timer { @@ -166,6 +171,16 @@ Page { label: qsTr("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 {