Add lots of fields for MQTT, OCPP, WiFi and fix documentation links

This commit is contained in:
2024-07-17 23:38:22 +02:00
parent 690c477f9e
commit 3c20fb2943
17 changed files with 989 additions and 358 deletions

View File

@@ -21,6 +21,7 @@ NavigationPage {
Button { Button {
text: qsTr("API documentation") text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/http-en.md"))
} }
RowLayout { RowLayout {
@@ -116,6 +117,7 @@ NavigationPage {
Button { Button {
text: qsTr("API documentation") text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/cloudapi-en.md"))
} }
} }
} }
@@ -148,6 +150,7 @@ NavigationPage {
Button { Button {
text: qsTr("API documentation") text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/gridapi-en.md"))
} }
} }
} }
@@ -167,6 +170,7 @@ NavigationPage {
Button { Button {
text: qsTr("API documentation") text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v1/blob/master/go-eCharger%20API%20v1%20EN.md"))
} }
} }
} }

View File

@@ -68,6 +68,7 @@ qt_add_qml_module(evcharger-app
ChargingSpeedPage.qml ChargingSpeedPage.qml
CloudPage.qml CloudPage.qml
CloudUrlsModel.qml CloudUrlsModel.qml
ConfirmingOnOffSwitch.qml
ConnectingScreen.qml ConnectingScreen.qml
ConnectionPage.qml ConnectionPage.qml
ControllerPage.qml ControllerPage.qml
@@ -128,7 +129,6 @@ qt_add_qml_module(evcharger-app
WhiteItemDelegate.qml WhiteItemDelegate.qml
WhiteSwipeDelegate.qml WhiteSwipeDelegate.qml
WiFiErrorsPage.qml WiFiErrorsPage.qml
WiFiOnOffSwitch.qml
WiFiPage.qml WiFiPage.qml
WiFiScanPage.qml WiFiScanPage.qml
RESOURCES RESOURCES

View File

@@ -3,5 +3,6 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
Dialog { Dialog {
anchors.centerIn: parent parent: Overlay.overlay
anchors.centerIn: Overlay.overlay
} }

View File

@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQml
import EVChargerApp import EVChargerApp
AnimatedStackView { AnimatedStackView {
@@ -177,7 +178,7 @@ AnimatedStackView {
visible: logicMode.value == 4 visible: logicMode.value == 4
iconSource: "material-icons/grid_guides.svg" iconSource: "material-icons/grid_guides.svg"
title: qsTr("Price limit") title: qsTr("Price limit")
description: qsTr("%0 ct/kWh").arg(priceLimitHelper.value) description: qsTr("%0 ct/kWh").arg(Qt.locale().toString(priceLimitHelper.value, 'f', 1))
component: "SetPriceLimitPage.qml" component: "SetPriceLimitPage.qml"
} }

View File

@@ -6,10 +6,11 @@ import EVChargerApp
NavigationPage { NavigationPage {
title: qsTr("Cloud") title: qsTr("Cloud")
GeneralOnOffSwitch { ConfirmingOnOffSwitch {
Layout.fillWidth: true
apiKey: "cwe" apiKey: "cwe"
text: qsTr("Enable cloud connection") text: qsTr("Enable cloud connection")
dialogTitle: qsTr("Are you sure?")
dialogText: qsTr("Disabling could connection could make your device unreachable from other places than home!")
} }
Text { Text {

View File

@@ -6,6 +6,10 @@ import EVChargerApp
WhiteCheckDelegate { WhiteCheckDelegate {
id: checkDelegate id: checkDelegate
required property string apiKey
required property string dialogTitle
required property string dialogText
Layout.fillWidth: true Layout.fillWidth: true
Component.onCompleted: { Component.onCompleted: {
@@ -13,23 +17,23 @@ WhiteCheckDelegate {
} }
ApiKeyValueHelper { ApiKeyValueHelper {
id: staEnabled id: apiKeyValueHelper
deviceConnection: theDeviceConnection deviceConnection: theDeviceConnection
apiKey: "wen" apiKey: checkDelegate.apiKey
} }
SetValueHelper { SetValueHelper {
id: staEnabledChanger id: setValueHelper
deviceConnection: theDeviceConnection deviceConnection: theDeviceConnection
apiKey: "wen" apiKey: checkDelegate.apiKey
} }
checked: staEnabled.value checked: apiKeyValueHelper.value
text: staEnabled.value ? qsTr("On") : qsTr("Off") text: apiKeyValueHelper.value === true ? qsTr("On") : apiKeyValueHelper.value === false ? qsTr("Off") : qsTr("Unknown")
onClicked: { onClicked: {
if (checked) if (checked)
staEnabledChanger.setValue(checked) setValueHelper.setValue(checked)
else { else {
checked = true checked = true
disableStaDialog.open() disableStaDialog.open()
@@ -37,29 +41,29 @@ WhiteCheckDelegate {
} }
BusyIndicator { BusyIndicator {
visible: staEnabledChanger.pending visible: setValueHelper.pending
} }
RequestStatusText { RequestStatusText {
request: staEnabledChanger request: setValueHelper
} }
CenteredDialog { CenteredDialog {
id: disableStaDialog id: disableStaDialog
title: qsTr("Are you sure?") title: checkDelegate.dialogTitle
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
focus: true focus: true
modal: true modal: true
onAccepted: { onAccepted: {
checkDelegate.checked = false checkDelegate.checked = false
staEnabledChanger.setValue(false) setValueHelper.setValue(false)
} }
onRejected: checkDelegate.checked = Qt.binding(function() { return staEnabled.value }) onRejected: checkDelegate.checked = Qt.binding(function() { return apiKeyValueHelper.value })
contentItem: Text { contentItem: Text {
text: qsTr("Disabling Wi-Fi could make your device unreachable from your local homenetwork or the cloud!"); text: checkDelegate.dialogText
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
} }

View File

@@ -71,7 +71,7 @@ Loader {
modal: true modal: true
onAccepted: theDeviceConnection.sendAuth(passwordInput.text) onAccepted: theDeviceConnection.sendAuth(passwordInput.text)
onRejected: loader.close() onRejected: loader.closeRequested()
contentItem: GridLayout { contentItem: GridLayout {
property int minimumInputSize: 120 property int minimumInputSize: 120
@@ -109,12 +109,12 @@ Loader {
id: authImpossibleDialog id: authImpossibleDialog
title: qsTr("Authentication impossible!") title: qsTr("Authentication impossible!")
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok
focus: true focus: true
modal: true modal: true
onAccepted: loader.close() onAccepted: loader.closeRequested()
onRejected: loader.close() onRejected: loader.closeRequested()
contentItem: Text { contentItem: Text {
text: qsTr("To use this password remotely a password has to be setup first. This can be done over the AccessPoint."); text: qsTr("To use this password remotely a password has to be setup first. This can be done over the AccessPoint.");

View File

@@ -34,6 +34,14 @@ WhiteItemDelegate {
text: itemDelegate.text text: itemDelegate.text
} }
BusyIndicator {
visible: setValueHelper.pending
}
RequestStatusText {
request: setValueHelper
}
Text { Text {
text: itemDelegate.valueText text: itemDelegate.valueText
} }

View File

@@ -29,7 +29,7 @@ WhiteCheckDelegate {
} }
checked: valueHelper.value checked: valueHelper.value
text: valueHelper.value ? qsTr("On") : qsTr("Off") text: valueHelper.value === true ? qsTr("On") : valueHelper.value === false ? qsTr("Off") : qsTr("Unknown")
onClicked: { onClicked: {
valueChanger.setValue(checked) valueChanger.setValue(checked)

View File

@@ -14,9 +14,33 @@ NavigationPage {
text: qsTr("Disable AP when online") text: qsTr("Disable AP when online")
} }
Text { EditValueItem {
text: "TODO" text: qsTr("SSID")
apiKey: "wan"
fullWidth: true
editableItem: TextField {
id: textField0
property alias value: textField0.text
}
}
Layout.fillHeight: true EditValueItem {
text: qsTr("Password")
apiKey: "wak"
fullWidth: true
editableItem: TextField {
id: textField1
property alias value: textField1.text
}
}
EditValueItem {
text: qsTr("Channel")
valueText: Qt.locale().toString(value)
apiKey: "wapc"
editableItem: SpinBox {
from: 0
to: 15
}
} }
} }

View File

@@ -10,6 +10,21 @@ NavigationPage {
apiKey: "mce" apiKey: "mce"
} }
EditValueItem {
text: qsTr("Broker url")
apiKey: "mcu"
fullWidth: true
editableItem: TextField {
id: textField0
property alias value: textField0.text
}
}
Button {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/mqtt-en.md"))
}
WhiteBox { WhiteBox {
Layout.fillWidth: true Layout.fillWidth: true
@@ -85,4 +100,59 @@ NavigationPage {
} }
} }
} }
GeneralOnOffSwitch {
apiKey: "mqg"
text: qsTr("Use global CA store")
}
GeneralOnOffSwitch {
apiKey: "mqcn"
text: qsTr("Skip cert commonName check")
}
GeneralOnOffSwitch {
apiKey: "mqss"
text: qsTr("Skip server cert verification")
}
// TODO clientKey
// TODO clientCert
// TODO serverCert
GeneralOnOffSwitch {
apiKey: "mcr"
text: qsTr("MQTT readonly")
}
EditValueItem {
// TODO allow set to null to reset to default
text: qsTr("Topic prefix")
apiKey: "mtp"
fullWidth: true
editableItem: TextField {
id: textField1
property alias value: textField1.text
}
}
GeneralOnOffSwitch {
id: homeassistant
apiKey: "mhe"
text: qsTr("Homeassistant autodiscover")
}
EditValueItem {
visible: homeassistant.checked
// TODO allow set to null to reset to default
text: qsTr("Homeassistant topic prefix")
apiKey: "mht"
fullWidth: true
editableItem: TextField {
id: textField2
property alias value: textField2.text
}
}
} }

View File

@@ -5,14 +5,7 @@ import QtQuick.Layouts
NavigationPage { NavigationPage {
title: qsTr("Name") title: qsTr("Name")
NavigationItem {
iconSource: "material-icons/grid_guides.svg"
title: qsTr("Name")
component: "NamePage.qml"
}
EditValueItem { EditValueItem {
id: test
text: qsTr("Name") text: qsTr("Name")
apiKey: "fna" apiKey: "fna"
fullWidth: true fullWidth: true

View File

@@ -10,6 +10,21 @@ NavigationPage {
apiKey: "ocppe" apiKey: "ocppe"
} }
EditValueItem {
text: qsTr("Backend url")
apiKey: "ocppu"
fullWidth: true
editableItem: TextField {
id: textField0
property alias value: textField0.text
}
}
Button {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/ocpp-en.md"))
}
WhiteBox { WhiteBox {
Layout.fillWidth: true Layout.fillWidth: true
@@ -129,4 +144,101 @@ NavigationPage {
} }
} }
} }
GeneralOnOffSwitch {
apiKey: "ocppg"
text: qsTr("Use global CA store")
}
GeneralOnOffSwitch {
apiKey: "ocppcn"
text: qsTr("Skip cert commonName check")
}
GeneralOnOffSwitch {
apiKey: "ocppss"
text: qsTr("Skip server cert verification")
}
// TODO clientKey
// TODO clientCert
// TODO serverCert
// TODO fallbackCurrentLimit
// TODO transactionId
EditValueItem {
text: qsTr("Heartbeat interval:")
valueText: Qt.locale().toString(value)
apiKey: "ocpph"
editableItem: SpinBox {
from: 0
to: 3600
}
}
EditValueItem {
text: qsTr("MeterValues sample interval:")
valueText: Qt.locale().toString(value)
apiKey: "ocppi"
editableItem: SpinBox {
from: 0
to: 3600
}
}
EditValueItem {
text: qsTr("Clock aligned data interval:")
valueText: Qt.locale().toString(value)
apiKey: "ocppai"
editableItem: SpinBox {
from: 0
to: 3600
}
}
EditValueItem {
text: qsTr("Dummy card id")
apiKey: "ocppd"
fullWidth: true
editableItem: TextField {
id: textField1
property alias value: textField1.text
}
}
GeneralOnOffSwitch {
apiKey: "ocppr"
text: qsTr("Rotate phases on charger")
}
GeneralOnOffSwitch {
apiKey: "ocppao"
text: qsTr("Allow Offline Tx For UnknownId")
}
GeneralOnOffSwitch {
apiKey: "ocpplo"
text: qsTr("Local Authorize Offline")
}
GeneralOnOffSwitch {
apiKey: "ocppla"
text: qsTr("Local Auth List Enabled")
}
// TODO MeterValuesCondition
GeneralOnOffSwitch {
apiKey: "ocppt"
text: qsTr("Accept time from backend")
}
GeneralOnOffSwitch {
apiKey: "ocppio"
text: qsTr("Set as inoperable")
}
} }

View File

@@ -12,9 +12,8 @@ NavigationPage {
} }
EditValueItem { EditValueItem {
id: test
text: qsTr("Price limit") text: qsTr("Price limit")
valueText: qsTr("%0 ct/kWh").arg(test.value) valueText: qsTr("%0 ct/kWh").arg(Qt.locale().toString(value, 'f', 1))
apiKey: "awp" apiKey: "awp"
editableItem: DoubleSpinBox { editableItem: DoubleSpinBox {
from: -1000. from: -1000.

View File

@@ -6,8 +6,10 @@ import EVChargerApp
NavigationPage { NavigationPage {
title: qsTr("Wi-Fi") title: qsTr("Wi-Fi")
WiFiOnOffSwitch { ConfirmingOnOffSwitch {
apiKey: "wen"
dialogTitle: qsTr("Are you sure?")
dialogText: qsTr("Disabling Wi-Fi could make your device unreachable from your local homenetwork or the cloud!")
} }
GridLayout { GridLayout {
@@ -84,7 +86,23 @@ NavigationPage {
} }
} }
Item { EditValueItem {
Layout.fillHeight: true text: qsTr("Min RSSI")
valueText: Qt.locale().toString(value)
apiKey: "wsmr"
editableItem: SpinBox {
from: -100
to: 0
}
}
GeneralOnOffSwitch {
apiKey: "wspc"
text: qsTr("Pmf capable")
}
GeneralOnOffSwitch {
apiKey: "wspr"
text: qsTr("Pmf required")
} }
} }

File diff suppressed because it is too large Load Diff

2
qmldir
View File

@@ -18,6 +18,7 @@ EVChargerApp 1.0 ChargingConfigurationPage.qml
EVChargerApp 1.0 ChargingSpeedPage.qml EVChargerApp 1.0 ChargingSpeedPage.qml
EVChargerApp 1.0 CloudPage.qml EVChargerApp 1.0 CloudPage.qml
EVChargerApp 1.0 CloudUrlsModel.qml EVChargerApp 1.0 CloudUrlsModel.qml
EVChargerApp 1.0 ConfirmingOnOffSwitch.qml
EVChargerApp 1.0 ConnectingScreen.qml EVChargerApp 1.0 ConnectingScreen.qml
EVChargerApp 1.0 ConnectionPage.qml EVChargerApp 1.0 ConnectionPage.qml
EVChargerApp 1.0 ControllerPage.qml EVChargerApp 1.0 ControllerPage.qml
@@ -78,6 +79,5 @@ EVChargerApp 1.0 WhiteCheckDelegate.qml
EVChargerApp 1.0 WhiteItemDelegate.qml EVChargerApp 1.0 WhiteItemDelegate.qml
EVChargerApp 1.0 WhiteSwipeDelegate.qml EVChargerApp 1.0 WhiteSwipeDelegate.qml
EVChargerApp 1.0 WiFiErrorsPage.qml EVChargerApp 1.0 WiFiErrorsPage.qml
EVChargerApp 1.0 WiFiOnOffSwitch.qml
EVChargerApp 1.0 WiFiPage.qml EVChargerApp 1.0 WiFiPage.qml
EVChargerApp 1.0 WiFiScanPage.qml EVChargerApp 1.0 WiFiScanPage.qml