From b4d116ab9c7b2faba49c9591f93de6dda84ea751 Mon Sep 17 00:00:00 2001 From: Mike Trahearn Date: Mon, 6 Jan 2025 16:08:58 +1000 Subject: [PATCH] Generator Control cards should not be displayed when startStop1 disabled Fixes #1239 --- data/common/Generator.qml | 5 +++++ pages/controlcards/GeneratorCard.qml | 1 + 2 files changed, 6 insertions(+) diff --git a/data/common/Generator.qml b/data/common/Generator.qml index af279ee6d..0a8516a91 100644 --- a/data/common/Generator.qml +++ b/data/common/Generator.qml @@ -14,6 +14,7 @@ Device { readonly property int manualStartTimer: _manualStartTimer.isValid ? _manualStartTimer.value : 0 readonly property int runtime: _runtime.value || 0 readonly property int runningBy: _runningBy.isValid ? _runningBy.value : 0 + readonly property bool enabled: _enabled.value === 1 readonly property string runningByText: Global.generators.runningByText(runningBy) readonly property string stateText: Global.generators.stateText(state) @@ -56,6 +57,10 @@ Device { uid: serviceUid + "/AutoStartEnabled" } + readonly property VeQuickItem _enabled: VeQuickItem { + uid: serviceUid + "/Enabled" + } + function start(durationSecs) { _manualStartTimer.setValue(durationSecs) _manualStart.setValue(1) diff --git a/pages/controlcards/GeneratorCard.qml b/pages/controlcards/GeneratorCard.qml index 2e852daad..5750cafa3 100644 --- a/pages/controlcards/GeneratorCard.qml +++ b/pages/controlcards/GeneratorCard.qml @@ -16,6 +16,7 @@ ControlCard { title.text: CommonWords.generator status.text: root.generator.stateText status.rightPadding: timerDisplay.width + Theme.geometry_controlCard_contentMargins + visible: root.generator.enabled GeneratorIconLabel { id: timerDisplay