Skip to content

Commit

Permalink
Fix: Add default if checkType is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying committed Nov 22, 2023
1 parent 387a9f3 commit fae742c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/monitor-types/mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class MqttMonitorType extends MonitorType {
interval: monitor.interval,
});

if (monitor.mqttCheckType == null || monitor.mqttCheckType === "") {
// use old default
monitor.mqttCheckType = "keyword";
}

if (monitor.mqttCheckType === "keyword") {
if (receivedMessage != null && receivedMessage.includes(monitor.mqttSuccessMessage)) {
heartbeat.msg = `Topic: ${monitor.mqttTopic}; Message: ${receivedMessage}`;
Expand Down

0 comments on commit fae742c

Please sign in to comment.