v2c-any 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,7 +47,7 @@ export class MqttBridgeService extends AbstractExecutableService {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
logger.info({ topic: this.properties.topic }, 'Subscribing to MQTT topic');
|
|
50
|
-
await this.client.subscribeAsync(this.properties.topic);
|
|
50
|
+
await this.client.subscribeAsync(this.properties.topic, { qos: 1 });
|
|
51
51
|
logger.info('MQTT bridge service started');
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -48,7 +48,10 @@ export class MqttService extends AbstractExecutableService {
|
|
|
48
48
|
throw new Error('MQTT client not initialized');
|
|
49
49
|
}
|
|
50
50
|
logger.debug({ value, topic }, 'Publishing MQTT message');
|
|
51
|
-
await this.client.publishAsync(topic, String(value)
|
|
51
|
+
await this.client.publishAsync(topic, String(value), {
|
|
52
|
+
qos: 1,
|
|
53
|
+
retain: true,
|
|
54
|
+
});
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
57
|
* Starts the MQTT client connection.
|