diff --git a/server/util-server.js b/server/util-server.js index a9ec89e66..7a9d3e7d1 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -135,10 +135,10 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) { if (messageTopic == topic) { client.end(); clearTimeout(timeoutID); - if (message.toString() === okMessage) { - resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`); + if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) { + reject(new Error(`Message Mismatch - Topic: ${messageTopic}; Message: ${message.toString()}`)); } else { - reject(new Error(`Error; Topic: ${messageTopic}; Message: ${message.toString()}`)); + resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`); } } }); diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 405ed5f85..9615ce6a4 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -141,7 +141,7 @@