lundi 2 novembre 2020

How can I use mqtt subscibe in a if else condition in python

I am trying to make a code that if a condition is true then only the client subscribes(MQTT subscribe) to a topic A else subscribes to the other topic say topic B(MQTT subscribe). But when I run the code and if it has subscribed once to topic A then even it goes in the else condition it prints the messages of both the topic A and topic B, when ideally it should only publish the messages of topic B.

Kindly help me with this issue guys.

Aucun commentaire:

Enregistrer un commentaire