mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-12 16:18:22 +00:00
24 lines
No EOL
702 B
C++
24 lines
No EOL
702 B
C++
#include "mqttcommands/hasNodeFailed.h"
|
|
|
|
MqttCommand_HasNodeFailed::MqttCommand_HasNodeFailed(QObject *parent) :
|
|
MqttCommand(parent)
|
|
{
|
|
this->m_requiredFields << "node";
|
|
}
|
|
MqttCommand* MqttCommand_HasNodeFailed::Create(QObject *parent) {
|
|
return new MqttCommand_HasNodeFailed(parent);
|
|
}
|
|
|
|
bool MqttCommand_HasNodeFailed::processMessage(QJsonDocument msg) {
|
|
QTOZWManager *mgr = getOZWManager();
|
|
if (mgr->hasNodeFailed(msg["node"].toInt())) {
|
|
QJsonObject js;
|
|
js["status"] = "ok";
|
|
emit sendCommandUpdate(GetCommand(), js);
|
|
return true;
|
|
}
|
|
QJsonObject js;
|
|
js["status"] = "failed";
|
|
emit sendCommandUpdate(GetCommand(), js);
|
|
return false;
|
|
} |