diff --git a/src/classes/MQTT.ts b/src/classes/MQTT.ts index c60fdbc..1a4684d 100644 --- a/src/classes/MQTT.ts +++ b/src/classes/MQTT.ts @@ -32,7 +32,7 @@ export default class MQTT { public publish(topic: string, message: string | Buffer) { return new Promise((res, rej) => { - this.client.publish(topic, message, (err) => { + this.client.publish(topic, message, { retain: true }, (err) => { if (err) { rej(err); } else {