mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-12 16:18:22 +00:00
Add a bunch of Manager Methods for MQTT Commands
This commit is contained in:
parent
ea376a48cd
commit
6a088c931b
67 changed files with 1272 additions and 13 deletions
24
qt-ozwdaemon/mqttcommands/checkLatestConfigFileRevision.cpp
Normal file
24
qt-ozwdaemon/mqttcommands/checkLatestConfigFileRevision.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "mqttcommands/checkLatestConfigFileRevision.h"
|
||||
|
||||
MqttCommand_CheckLatestConfigFileRevision::MqttCommand_CheckLatestConfigFileRevision(QObject *parent) :
|
||||
MqttCommand(parent)
|
||||
{
|
||||
this->m_requiredFields << "node";
|
||||
}
|
||||
MqttCommand* MqttCommand_CheckLatestConfigFileRevision::Create(QObject *parent) {
|
||||
return new MqttCommand_CheckLatestConfigFileRevision(parent);
|
||||
}
|
||||
|
||||
bool MqttCommand_CheckLatestConfigFileRevision::processMessage(QJsonDocument msg) {
|
||||
QTOZWManager *mgr = getOZWManager();
|
||||
if (mgr->checkLatestConfigFileRevision(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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue