Add factory reset network method
parent
a171879db7
commit
e2735428b8
|
|
@ -97,6 +97,13 @@ void ZigbeeManager::setPermitJoin(const QUuid &networkUuid, uint duration)
|
|||
m_client->sendCommand("Zigbee.SetPermitJoin", params, this, "setPermitJoinResponse");
|
||||
}
|
||||
|
||||
void ZigbeeManager::factoryResetNetwork(const QUuid &networkUuid)
|
||||
{
|
||||
QVariantMap params;
|
||||
params.insert("networkUuid", networkUuid);
|
||||
m_client->sendCommand("Zigbee.FactoryResetNetwork", params, this, "factoryResetNetworkResponse");
|
||||
}
|
||||
|
||||
void ZigbeeManager::init()
|
||||
{
|
||||
// FIXME: load only when used
|
||||
|
|
@ -145,6 +152,11 @@ void ZigbeeManager::setPermitJoinResponse(int commandId, const QVariantMap ¶
|
|||
qDebug() << "Zigbee set permit join network response" << commandId << params;
|
||||
}
|
||||
|
||||
void ZigbeeManager::factoryResetNetworkResponse(int commandId, const QVariantMap ¶ms)
|
||||
{
|
||||
qDebug() << "Zigbee factory reset network response" << commandId << params;
|
||||
}
|
||||
|
||||
void ZigbeeManager::notificationReceived(const QVariantMap ¬ification)
|
||||
{
|
||||
QString notificationString = notification.value("notification").toString();
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
Q_INVOKABLE void addNetwork(const QString &serialPort, uint baudRate, ZigbeeAdapter::ZigbeeBackendType backendType);
|
||||
Q_INVOKABLE void removeNetwork(const QUuid &networkUuid);
|
||||
Q_INVOKABLE void setPermitJoin(const QUuid &networkUuid, uint duration = 120);
|
||||
Q_INVOKABLE void factoryResetNetwork(const QUuid &networkUuid);
|
||||
|
||||
void init();
|
||||
|
||||
|
|
@ -70,6 +71,7 @@ private:
|
|||
Q_INVOKABLE void addNetworkResponse(int commandId, const QVariantMap ¶ms);
|
||||
Q_INVOKABLE void removeNetworkResponse(int commandId, const QVariantMap ¶ms);
|
||||
Q_INVOKABLE void setPermitJoinResponse(int commandId, const QVariantMap ¶ms);
|
||||
Q_INVOKABLE void factoryResetNetworkResponse(int commandId, const QVariantMap ¶ms);
|
||||
|
||||
|
||||
Q_INVOKABLE void notificationReceived(const QVariantMap ¬ification);
|
||||
|
|
|
|||
|
|
@ -114,7 +114,10 @@ SettingsPageBase {
|
|||
Layout.leftMargin: app.margins
|
||||
Layout.rightMargin: app.margins
|
||||
text: qsTr("Factory reset controller")
|
||||
onClicked: print("Reset clicked")
|
||||
onClicked: {
|
||||
engine.zigbeeManager.factoryResetNetwork(root.network.networkUuid)
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue