1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

MQTT In subscription qos not defaulting properly

This commit is contained in:
Nick O'Leary 2016-06-20 21:35:43 +01:00
parent e50d04077b
commit 2b9bfbc309

View File

@ -314,8 +314,10 @@ module.exports = function(RED) {
function MQTTInNode(n) {
RED.nodes.createNode(this,n);
this.topic = n.topic;
this.qos = parseInt(n.qos===undefined?"2":n.qos);
this.qos = parseInt(n.qos);
if (isNaN(this.qos) || this.qos < 0 || this.qos > 2) {
this.qos = 2;
}
this.broker = n.broker;
this.brokerConn = RED.nodes.getNode(this.broker);
if (!/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/.test(this.topic)) {