handle retained messages, introduc missing event detector
This commit is contained in:
5
dist/mqttdispatcher.js
vendored
5
dist/mqttdispatcher.js
vendored
@ -60,8 +60,11 @@ class MqttDispatcher {
|
||||
this.mqttClient.subscribe(topicHandler.topic);
|
||||
}
|
||||
});
|
||||
this.mqttClient.on('message', (topic, payload) => {
|
||||
this.mqttClient.on('message', (topic, payload, packet) => {
|
||||
log.info(`message received, topic ${topic}, payload ${payload}`);
|
||||
if (packet.retain) {
|
||||
log.info("IS RETAINED");
|
||||
}
|
||||
for (let topicHandler of this.topicHandlers) {
|
||||
if (this.topicMatch(topicHandler.topic, topic)) {
|
||||
log.info(`received topic ${topic} matches registered topic ${topicHandler.topic}`);
|
||||
|
Reference in New Issue
Block a user