[MQTT] Try to improve error handling

This commit is contained in:
Louis Lam
2022-01-13 12:42:34 +08:00
parent 6272514820
commit 227bbdea2f
2 changed files with 40 additions and 31 deletions

View File

@@ -351,7 +351,7 @@ class Monitor extends BeanModel {
}
} else if (this.type === "mqtt") {
try {
bean.msg = await mqttAsync(this.url, this.mqttTopic, this.mqttSuccessMessage, {
bean.msg = await mqttAsync(this.hostname, this.mqttTopic, this.mqttSuccessMessage, {
mqttPort: this.port,
mqttUsername: this.mqttUsername,
mqttPassword: this.mqttPassword,