From 60df0928c1fa0c2814c80d7cae4b5195a59c7696 Mon Sep 17 00:00:00 2001 From: Sohaib90 Date: Thu, 19 Jan 2023 21:05:18 +0100 Subject: [PATCH] added default topic,qos to self.topics --- flask_mqtt/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flask_mqtt/__init__.py b/flask_mqtt/__init__.py index 92b5a04..356d524 100644 --- a/flask_mqtt/__init__.py +++ b/flask_mqtt/__init__.py @@ -317,6 +317,8 @@ def subscribe(self, topic, qos: int = 0) -> Tuple[int, int]: elif isinstance(topic, list): for t, q in topic: self.topics[t] = TopicQos(topic=t, qos=q) + else: + self.topics[topic] = TopicQos(topic=topic, qos=qos) logger.debug("Subscribed to topic: {0}, qos: {1}".format(topic, qos)) else: logger.error("Error {0} subscribing to topic: {1}".format(result, topic))