mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-12 08:08:21 +00:00
tests for required fields on commands and some logging updates
This commit is contained in:
parent
3d7c8db9e4
commit
5e1b41e212
34 changed files with 291 additions and 130 deletions
|
@ -3,13 +3,20 @@
|
|||
MqttCommand_RefreshNodeInfo::MqttCommand_RefreshNodeInfo(QObject *parent) :
|
||||
MqttCommand(parent)
|
||||
{
|
||||
this->m_requiredFields << "node";
|
||||
this->m_requiredIntFields << "node";
|
||||
}
|
||||
MqttCommand* MqttCommand_RefreshNodeInfo::Create(QObject *parent) {
|
||||
return new MqttCommand_RefreshNodeInfo(parent);
|
||||
}
|
||||
|
||||
bool MqttCommand_RefreshNodeInfo::processMessage(QJsonDocument msg) {
|
||||
if (!this->checkNode(msg, "node")) {
|
||||
QJsonObject js;
|
||||
js["status"] = "failed";
|
||||
js["Error"] = "Invalid Node Number";
|
||||
emit sendCommandUpdate(GetCommand(), js);
|
||||
return false;
|
||||
}
|
||||
QTOZWManager *mgr = getOZWManager();
|
||||
if (mgr->refreshNodeInfo(msg["node"].toInt())) {
|
||||
QJsonObject js;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue