From d0fed74a24c1a81fab10f6f483fe4fbe22afa0c4 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 25 Apr 2023 15:08:42 +0200 Subject: [PATCH] Improvements for action logs --- nymea-app/ui/devicepages/GenericThingPage.qml | 7 +++++-- nymea-app/ui/devicepages/StateLogPage.qml | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/nymea-app/ui/devicepages/GenericThingPage.qml b/nymea-app/ui/devicepages/GenericThingPage.qml index 3962fefa..dcb51884 100644 --- a/nymea-app/ui/devicepages/GenericThingPage.qml +++ b/nymea-app/ui/devicepages/GenericThingPage.qml @@ -358,8 +358,10 @@ ThingPageBase { text: actionType.displayName } - Button { - Layout.fillWidth: true + ProgressButton { +// Layout.fillWidth: true + imageSource: "send" + longpressEnabled: false onClicked: { if (actionDelegate.actionType.paramTypes.count === 0) { @@ -423,6 +425,7 @@ ThingPageBase { Item { Layout.preferredHeight: preferredSize Layout.preferredWidth: preferredSize + visible: preferredSize > 0 property int preferredSize: actionDelegate.pendingActionId !== -1 || pendingTimer.running ? Style.iconSize : 0 Behavior on preferredSize { NumberAnimation { duration: 100 } } diff --git a/nymea-app/ui/devicepages/StateLogPage.qml b/nymea-app/ui/devicepages/StateLogPage.qml index 532aee9b..9ba29845 100644 --- a/nymea-app/ui/devicepages/StateLogPage.qml +++ b/nymea-app/ui/devicepages/StateLogPage.qml @@ -45,10 +45,11 @@ Page { readonly property bool isLogged: thing.loggedStateTypeIds.indexOf(stateType.id) >= 0 readonly property bool canShowGraph: { - switch (root.stateType.type) { - case "Int": - case "Double": - case "Bool": + switch (root.stateType.type.toLowerCase()) { + case "int": + case "uint": + case "double": + case "bool": return true; } print("not showing graph for", root.stateType.type) @@ -119,10 +120,9 @@ Page { delegate: NymeaItemDelegate { width: listView.width property NewLogEntry entry: logsModel.get(index) - text: entry.values[root.stateType.name] + text: Types.toUiValue(entry.values[root.stateType.name], root.stateType.unit) + " " + Types.toUiUnit(root.stateType.unit) subText: entry.timestamp.toLocaleString(Qt.locale()) progressive: false - Component.onCompleted: print("delegate:", JSON.stringify(entry.values), root.stateType.name, entry.values[root.stateType.name]) } } }