Merge PR #857: Show more details about the zwave controller

pull/860/head
jenkins 2022-08-04 22:27:11 +02:00
commit 4e2bb54570
4 changed files with 30 additions and 14 deletions

View File

@ -72,6 +72,19 @@ void ZWaveNetwork::setIsStaticUpdateController(bool isStaticUpdateController)
}
}
bool ZWaveNetwork::isBridgeController() const
{
return m_isBridgeController;
}
void ZWaveNetwork::setIsBridgeController(bool isBridgeController)
{
if (m_isBridgeController != isBridgeController) {
m_isBridgeController = isBridgeController;
emit isBridgeControllerChanged();
}
}
bool ZWaveNetwork::waitingForNodeAddition() const
{
return m_waitingForNodeAddition;

View File

@ -17,6 +17,7 @@ class ZWaveNetwork : public QObject
Q_PROPERTY(bool isZWavePlus READ isZWavePlus NOTIFY isZWavePlusChanged)
Q_PROPERTY(bool isPrimaryController READ isPrimaryController NOTIFY isPrimaryControllerChanged)
Q_PROPERTY(bool isStaticUpdateController READ isStaticUpdateController NOTIFY isStaticUpdateControllerChanged)
Q_PROPERTY(bool isBridgeController READ isBridgeController NOTIFY isBridgeControllerChanged)
Q_PROPERTY(bool waitingForNodeAddition READ waitingForNodeAddition NOTIFY waitingForNodeAdditionChanged)
Q_PROPERTY(bool waitingForNodeRemoval READ waitingForNodeRemoval NOTIFY waitingForNodeRemovalChanged)
Q_PROPERTY(ZWaveNetworkState networkState READ networkState NOTIFY networkStateChanged)
@ -47,6 +48,9 @@ public:
bool isStaticUpdateController() const;
void setIsStaticUpdateController(bool isStaticUpdateController);
bool isBridgeController() const;
void setIsBridgeController(bool isBridgeController);
bool waitingForNodeAddition() const;
void setWaitingForNodeAddition(bool waitingForNodeAddition);
@ -67,6 +71,7 @@ signals:
void isZWavePlusChanged();
void isPrimaryControllerChanged();
void isStaticUpdateControllerChanged();
void isBridgeControllerChanged();
void waitingForNodeAdditionChanged();
void waitingForNodeRemovalChanged();
@ -77,6 +82,7 @@ private:
bool m_isZWavePlus = false;
bool m_isPrimaryController = false;
bool m_isStaticUpdateController = false;
bool m_isBridgeController = false;
bool m_waitingForNodeAddition = false;
bool m_waitingForNodeRemoval = false;
ZWaveNetworkState m_networkState = ZWaveNetworkStateOffline;

View File

@ -201,19 +201,6 @@ SettingsPageBase {
}
}
}
RowLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
text: qsTr("Controller type")
}
Label {
text: network.isPrimaryController ? qsTr("Primary") : qsTr("Secondary") + (network.isStaticUpdateController ? ", " + qsTr("Static") : "")
}
}
}
SettingsPageSectionHeader {
@ -255,7 +242,7 @@ SettingsPageBase {
Layout.fillWidth: true
Layout.margins: Style.margins
horizontalAlignment: Text.AlignHCenter
text: qsTr("There are no ZigBee devices connected yet. Open the network for new devices to join and start the pairing procedure from the ZigBee device. Please refer to the devices manual for more information on how to start the pairing.")
text: qsTr("There are no Z-Wave devices connected yet. Open the network for new devices to join and start the pairing procedure from the Z-Wave device. Please refer to the devices manual for more information on how to start the pairing.")
wrapMode: Text.WordWrap
visible: nodesModel.count === 0
}
@ -301,6 +288,7 @@ SettingsPageBase {
busy: !node.initialized
canDelete: node.failed
// canDelete: true
onDeleteClicked: {
var dialog = removeZWaveNodeDialogComponent.createObject(app, {zwaveNode: node})
dialog.open()

View File

@ -131,6 +131,15 @@ SettingsPageBase {
progressive: false
}
NymeaItemDelegate {
Layout.fillWidth: true
text: qsTr("Controller type")
subText: network.isPrimaryController ? qsTr("Primary") : qsTr("Secondary")
+ (network.isStaticUpdateController ? ", " + qsTr("Static") : "")
+ (network.isBridgeController ? ", " + qsTr("Bridge") : "")
progressive: false
}
SettingsPageSectionHeader {
text: qsTr("Hardware information")
}