mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-03-15 19:41:24 +00:00
parent
e26e6660a1
commit
bcf82abe85
2 changed files with 35 additions and 0 deletions
18
qt-ozwdaemon/mqttcommands/disablePoll.cpp
Normal file
18
qt-ozwdaemon/mqttcommands/disablePoll.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "mqttcommands/disablePoll.h"
|
||||
|
||||
MqttCommand_DisablePoll::MqttCommand_DisablePoll(QObject *parent) :
|
||||
MqttCommand(parent)
|
||||
{
|
||||
this->m_requiredIntFields << "ValueIDKey";
|
||||
}
|
||||
MqttCommand* MqttCommand_DisablePoll::Create(QObject *parent) {
|
||||
return new MqttCommand_DisablePoll(parent);
|
||||
}
|
||||
|
||||
bool MqttCommand_DisablePoll::processMessage(rapidjson::Document &msg) {
|
||||
if (!this->checkValue(msg, "ValueIDKey")) {
|
||||
return this->sendSimpleStatus(false, "Invalid ValueIDKey Number");
|
||||
}
|
||||
QTOZWManager *mgr = getOZWManager();
|
||||
return this->sendSimpleStatus(mgr->disablePoll(msg["ValueIdKey"].GetUint64()));
|
||||
}
|
17
qt-ozwdaemon/mqttcommands/disablePoll.h
Normal file
17
qt-ozwdaemon/mqttcommands/disablePoll.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifndef DISABLEPOLL_H
|
||||
#define DISABLEPOLL_H
|
||||
|
||||
#include "mqttcommands/mqttcommands.h"
|
||||
|
||||
class MqttCommand_DisablePoll : public MqttCommand {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static MqttCommand *Create(QObject *parent = nullptr);
|
||||
static QString StaticGetCommand() { return "disablePoll";};
|
||||
QString GetCommand() override { return StaticGetCommand(); };
|
||||
bool processMessage(rapidjson::Document &) override;
|
||||
private:
|
||||
MqttCommand_DisablePoll(QObject *parent = nullptr);
|
||||
};
|
||||
|
||||
#endif // PING_H
|
Loading…
Add table
Reference in a new issue