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 {
text: qsTr("API documentation")
onClicked: Qt.openUrlExternally(qsTr("https://github.com/goecharger/go-eCharger-API-v2/blob/main/http-en.md"))
}
RowLayout {
@@ -116,6 +117,7 @@ NavigationPage {
Button {
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 {
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 {
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
CloudPage.qml
CloudUrlsModel.qml
ConfirmingOnOffSwitch.qml
ConnectingScreen.qml
ConnectionPage.qml
ControllerPage.qml
@@ -128,7 +129,6 @@ qt_add_qml_module(evcharger-app
WhiteItemDelegate.qml
WhiteSwipeDelegate.qml
WiFiErrorsPage.qml
WiFiOnOffSwitch.qml
WiFiPage.qml
WiFiScanPage.qml
RESOURCES

View File

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

View File

@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml
import EVChargerApp
AnimatedStackView {
@@ -177,7 +178,7 @@ AnimatedStackView {
visible: logicMode.value == 4
iconSource: "material-icons/grid_guides.svg"
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"
}

View File

@@ -6,10 +6,11 @@ import EVChargerApp
NavigationPage {
title: qsTr("Cloud")
GeneralOnOffSwitch {
Layout.fillWidth: true
ConfirmingOnOffSwitch {
apiKey: "cwe"
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 {

View File

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

View File

@@ -71,7 +71,7 @@ Loader {
modal: true
onAccepted: theDeviceConnection.sendAuth(passwordInput.text)
onRejected: loader.close()
onRejected: loader.closeRequested()
contentItem: GridLayout {
property int minimumInputSize: 120
@@ -109,12 +109,12 @@ Loader {
id: authImpossibleDialog
title: qsTr("Authentication impossible!")
standardButtons: Dialog.Ok | Dialog.Cancel
standardButtons: Dialog.Ok
focus: true
modal: true
onAccepted: loader.close()
onRejected: loader.close()
onAccepted: loader.closeRequested()
onRejected: loader.closeRequested()
contentItem: Text {
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
}
BusyIndicator {
visible: setValueHelper.pending
}
RequestStatusText {
request: setValueHelper
}
Text {
text: itemDelegate.valueText
}

View File

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

View File

@@ -14,9 +14,33 @@ NavigationPage {
text: qsTr("Disable AP when online")
}
Text {
text: "TODO"
EditValueItem {
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"
}
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 {
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 {
title: qsTr("Name")
NavigationItem {
iconSource: "material-icons/grid_guides.svg"
title: qsTr("Name")
component: "NamePage.qml"
}
EditValueItem {
id: test
text: qsTr("Name")
apiKey: "fna"
fullWidth: true

View File

@@ -10,6 +10,21 @@ NavigationPage {
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 {
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 {
id: test
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"
editableItem: DoubleSpinBox {
from: -1000.

View File

@@ -6,8 +6,10 @@ import EVChargerApp
NavigationPage {
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 {
@@ -84,7 +86,23 @@ NavigationPage {
}
}
Item {
Layout.fillHeight: true
EditValueItem {
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 CloudPage.qml
EVChargerApp 1.0 CloudUrlsModel.qml
EVChargerApp 1.0 ConfirmingOnOffSwitch.qml
EVChargerApp 1.0 ConnectingScreen.qml
EVChargerApp 1.0 ConnectionPage.qml
EVChargerApp 1.0 ControllerPage.qml
@@ -78,6 +79,5 @@ EVChargerApp 1.0 WhiteCheckDelegate.qml
EVChargerApp 1.0 WhiteItemDelegate.qml
EVChargerApp 1.0 WhiteSwipeDelegate.qml
EVChargerApp 1.0 WiFiErrorsPage.qml
EVChargerApp 1.0 WiFiOnOffSwitch.qml
EVChargerApp 1.0 WiFiPage.qml
EVChargerApp 1.0 WiFiScanPage.qml