diff --git a/AppInstance.qml b/AppInstance.qml
index 809fe38..f623b36 100644
--- a/AppInstance.qml
+++ b/AppInstance.qml
@@ -17,6 +17,7 @@ AnimatedStackView {
}
initialItem: DeviceListScreen {
+ id: deviceListScreen
onDeviceSelected: (url, password) => stackView.push(deviceScreenComponent, { url, password })
}
@@ -24,7 +25,7 @@ AnimatedStackView {
id: deviceScreenComponent
DeviceScreen {
- onCloseRequested: stackView.pop()
+ onCloseRequested: stackView.pop(deviceListScreen)
}
}
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a0eebc..c8c89b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,6 +62,7 @@ qt_add_qml_module(evcharger-app
BaseNavigationPage.qml
CablePage.qml
CarPage.qml
+ CellularPage.qml
CenteredDialog.qml
ChargerTabPage.qml
ChargingConfigurationPage.qml
diff --git a/CellularPage.qml b/CellularPage.qml
new file mode 100644
index 0000000..da60b7a
--- /dev/null
+++ b/CellularPage.qml
@@ -0,0 +1,56 @@
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import EVChargerApp
+
+NavigationPage {
+ title: qsTr("Cellular")
+
+ ConfirmingOnOffSwitch {
+ apiKey: "cen"
+ dialogTitle: qsTr("Are you sure?")
+ dialogText: qsTr("Disabling Cellular could make your device unreachable from the cloud!")
+ }
+
+ EditValueItem {
+ text: qsTr("APN")
+ apiKey: "moap"
+ fullWidth: true
+ editableItem: TextField {
+ id: textField0
+ property alias value: textField0.text
+ }
+ }
+
+ EditValueItem {
+ text: qsTr("PIN")
+ apiKey: "mopi"
+ fullWidth: true
+ editableItem: TextField {
+ id: textField1
+ property alias value: textField1.text
+ }
+ }
+
+ // TODO auth Type
+
+ EditValueItem {
+ text: qsTr("Username")
+ apiKey: "mau"
+ fullWidth: true
+ editableItem: TextField {
+ id: textField2
+ property alias value: textField2.text
+ }
+ }
+
+ EditValueItem {
+ text: qsTr("Password")
+ apiKey: "mpap"
+ fullWidth: true
+ editableItem: TextField {
+ id: textField3
+ property alias value: textField3.text
+ }
+ }
+}
diff --git a/ConnectionPage.qml b/ConnectionPage.qml
index 857944c..fae20a9 100644
--- a/ConnectionPage.qml
+++ b/ConnectionPage.qml
@@ -13,6 +13,13 @@ NavigationPage {
visible: wifiStaApiKeyValueHelper.exists
}
+ NavigationItem {
+ iconSource: "material-icons/grid_guides.svg"
+ title: qsTr("Cellular")
+ component: "CellularPage.qml"
+ visible: cellularApiKeyValueHelper.exists
+ }
+
NavigationItem {
iconSource: "material-icons/grid_guides.svg"
title: qsTr("Hotspot")
diff --git a/DeviceScreen.qml b/DeviceScreen.qml
index ffed4fe..515316b 100644
--- a/DeviceScreen.qml
+++ b/DeviceScreen.qml
@@ -12,7 +12,12 @@ Loader {
property alias password: theDeviceConnection.password
function backPressed() {
- return item.backPressed()
+ if (connectionDisturbed.visible) {
+ closeRequested()
+ return true
+ }
+ else
+ return item.backPressed()
}
ListModel {
@@ -34,6 +39,9 @@ Loader {
onLogMessage: (message) => collectedMessages.push(message)
+ onShowDisturbed: connectionDisturbed.open()
+ onHideDisturbed: connectionDisturbed.close()
+
onAuthRequired: {
passwordError.visible = false;
passwordDialog.open();
@@ -120,4 +128,26 @@ Loader {
text: qsTr("To use this password remotely a password has to be setup first. This can be done over the AccessPoint.");
}
}
+
+ Popup {
+ id: connectionDisturbed
+
+ parent: Overlay.overlay
+ anchors.centerIn: Overlay.overlay
+
+ // x: 100
+ // y: 100
+ // width: 200
+ // height: 300
+
+ modal: true
+ focus: true
+
+ closePolicy: Popup.NoAutoClose
+
+ contentItem: Text {
+ text: qsTr("Connection disturbed")
+ wrapMode: Text.Wrap
+ }
+ }
}
diff --git a/SettingsTabPage.qml b/SettingsTabPage.qml
index 7ee1103..4496dbf 100644
--- a/SettingsTabPage.qml
+++ b/SettingsTabPage.qml
@@ -60,6 +60,11 @@ AnimatedStackView {
deviceConnection: theDeviceConnection
apiKey: "wen"
}
+ ApiKeyValueHelper {
+ id: cellularApiKeyValueHelper
+ deviceConnection: theDeviceConnection
+ apiKey: "cen"
+ }
ApiKeyValueHelper {
id: wifiApApiKeyValueHelper
deviceConnection: theDeviceConnection
@@ -90,6 +95,7 @@ AnimatedStackView {
title: qsTr("Connection")
description: [
wifiStaApiKeyValueHelper.exists ? qsTr("Wi-Fi") : null,
+ cellularApiKeyValueHelper.exists ? qsTr("Cellular") : null,
wifiApApiKeyValueHelper.exists ? qsTr("Hotspot") : null,
ethernetApiKeyValueHelper.exists ? qsTr("Ethernet") : null,
cloudApiKeyValueHelper.exists ? qsTr("Cloud") : null,
diff --git a/deviceconnection.cpp b/deviceconnection.cpp
index 43e2152..ca2025e 100644
--- a/deviceconnection.cpp
+++ b/deviceconnection.cpp
@@ -132,6 +132,7 @@ void DeviceConnection::messageReceived(const QVariant &variant)
}
const auto &type = typeVariant.toString();
+ qDebug() << type;
bool omitLog{};
if (type == "hello")
@@ -277,6 +278,8 @@ void DeviceConnection::messageReceived(const QVariant &variant)
{
omitLog = true;
+ emit hideDisturbed();
+
bool partial{};
if (auto iter = map.find("partial"); iter != std::cend(map))
@@ -359,6 +362,10 @@ void DeviceConnection::messageReceived(const QVariant &variant)
}
}
}
+ else if (type == "offline")
+ {
+ emit showDisturbed();
+ }
if (!omitLog)
{
@@ -465,6 +472,8 @@ void DeviceConnection::disconnected()
qDebug() << "called";
emit logMessage(tr("Disconnected!"));
+ emit showDisturbed();
+
emit logMessage(tr("Reconnecting to %0").arg(m_url));
QTimer::singleShot(1s, this, [this](){
m_websocket.open(QUrl{m_url});
diff --git a/deviceconnection.h b/deviceconnection.h
index 80580ce..56b4187 100644
--- a/deviceconnection.h
+++ b/deviceconnection.h
@@ -52,6 +52,8 @@ signals:
void passwordChanged(const QString &password);
void logMessage(const QString &message);
+ void showDisturbed();
+ void hideDisturbed();
void responseReceived(const QString &requestId, const QVariantMap &message);
diff --git a/i18n/qml_de.ts b/i18n/qml_de.ts
index 39e953e..9937862 100644
--- a/i18n/qml_de.ts
+++ b/i18n/qml_de.ts
@@ -261,6 +261,51 @@
Auto
+
+ CellularPage
+
+
+
+ Cellular
+ Mobilfunk
+
+
+
+
+ Are you sure?
+ Sind Sie sicher?
+
+
+
+
+ Disabling Cellular could make your device unreachable from the cloud!
+ Wenn die Mobilfunkverbindung ausgeschaltet wird, kann Ihr Gerät unerreichbar werden, wenn die App über Mobilfunk verbunden ist!
+
+
+
+
+ APN
+ APN
+
+
+
+
+ PIN
+ PIN
+
+
+
+
+ Username
+ Benutzername
+
+
+
+
+ Password
+ Passwort
+
+
ChargerTabPage
@@ -597,36 +642,42 @@
- Hotspot
- Hotspot
+ Cellular
+ Mobilfunk
- Ethernet
- Ethernet
-
-
-
-
- OCPP
- OCPP
+ Hotspot
+ Hotspot
- Cloud
- Cloud
+ Ethernet
+ Ethernet
- MQTT
- MQTT
+ OCPP
+ OCPP
+
+
+
+
+ Cloud
+ Cloud
+ MQTT
+ MQTT
+
+
+
+
API Settings
API Einstellungen
@@ -705,42 +756,42 @@
-
+
Received hello without serial!
-
+
Received hello with a non-string serial!
-
+
Received hello with a non-bool secured!
-
+
Received hello without manufacturer!
-
+
Received hello with a non-string manufacturer!
-
+
Received hello without friendly_name!
-
+
Received hello with a non-string friendly_name!
-
+
Received hello without devicetype!
@@ -755,142 +806,142 @@
-
+
Received hello with a non-string devicetype!
-
+
Received authRequired without token1!
-
+
Received authRequired with a non-string token1!
-
+
Received authRequired without token2!
-
+
Received authRequired with a non-string token2!
-
+
Received fullStatus with a non-bool partial!
-
+
Received fullStatus without a status!
-
+
Received fullStatus with a non-object status!
-
+
Received partial fullStatus
-
+
Received last fullStatus
-
+
Received deltaStatus without a status!
-
+
Received deltaStatus with a non-object status!
-
+
Received message type %0 %1
-
+
Received message with a non-string requestId!
-
+
Sending %0
-
+
Connected!
Verbunden!
-
+
Disconnected!
Verbindung verloren!
-
+
Reconnecting to %0
Verbinde wieder zu %0
-
+
state changed: %0
-
+
could not parse received json: %0 at offset %1
-
+
unknown binary message type %0 received
-
+
error occured: %0
-
+
ssl peer verify error
-
+
ssl errors
-
+
ssl alert sent level=%0 type=%1 description=%2
-
+
ssl alert received level=%0 type=%1 description=%2
-
+
ssl handshake interrupted on error
-
+
unknown response type %0
@@ -1033,35 +1084,41 @@
DeviceScreen
-
-
+
+
Password required
Passwort erforderlich
-
-
+
+
Password:
Passwort:
-
-
+
+
Password
Passwort
-
-
+
+
Authentication impossible!
Authentifizierung unmöglich!
-
-
+
+
To use this password remotely a password has to be setup first. This can be done over the AccessPoint.
Um dieses Gerät aus der Ferne nutzen zu können, müssen Sie erst ein Passwort einrichten. Dies kann über den AccessPoint gemacht werden.
+
+
+
+ Connection disturbed
+ Verbindung schwer gestört
+
DevicesModel
@@ -2184,104 +2241,110 @@
Kategorien
-
-
+
+
Wi-Fi
WLAN
-
-
+
+
+ Cellular
+ Mobilfunk
+
+
+
+
Hotspot
Hotspot
-
-
+
+
Ethernet
Ethernet
-
-
+
+
OCPP
OCPP
-
-
+
+
Cloud
Cloud
-
-
+
+
MQTT
MQTT
-
-
+
+
API Settings
API Einstellungen
-
-
+
+
Name
Name
-
-
+
+
Switch Language
Sprache ändern
-
-
+
+
Notifications
Benachrichtigungen
-
-
+
+
Date and time
Datum und Uhrzeit
-
-
+
+
LED
LED
-
-
+
+
Controller
Controller
-
-
+
+
Display settings
Display
-
-
+
+
Firmware
Firmware
-
-
+
+
Hardware information
Hardwareinformationen
-
-
+
+
Licenses
Lizenzen
@@ -2310,8 +2373,8 @@
Sensoren • Kategorien
-
-
+
+
Connection
Verbindung
@@ -2320,8 +2383,8 @@
WLAN • Hotspot • OCPP • API Einstellungen
-
-
+
+
General
Allgemein
@@ -2330,8 +2393,8 @@
Name • Sprache ändern • Benachrichtigungen • Datum und Uhrzeit • LED • Controller
-
-
+
+
About
Über
diff --git a/qmldir b/qmldir
index 808fd5a..fe9f1bc 100644
--- a/qmldir
+++ b/qmldir
@@ -12,6 +12,7 @@ EVChargerApp 1.0 AppSettingsPage.qml
EVChargerApp 1.0 BaseNavigationPage.qml
EVChargerApp 1.0 CablePage.qml
EVChargerApp 1.0 CarPage.qml
+EVChargerApp 1.0 CellularPage.qml
EVChargerApp 1.0 CenteredDialog.qml
EVChargerApp 1.0 ChargerTabPage.qml
EVChargerApp 1.0 ChargingConfigurationPage.qml