aiomqtt
aiomqtt copied to clipboard
Question: How can I add further subscriptions at runtime.
Hi The advanced example is working well. How can I add further subscriptions at runtime?
Hi Manuel. Thanks for the question. :)
Glad to hear that the advanced example works for you. You can call client.subscribe
as many times as you want.
If that doesn't answer your question then please show us (with code) what you've tried so far. :+1:
Also related:
I have used client.subscribe()
at runtime which works well. Is there also a way to update the filtered topics too? Otherwise it would default to incoming messages being handled by the unfiltered messages task/function.
Hi chan-vince. Thanks for the question. Let me try to answer.
Is there also a way to update the filtered topics too? Otherwise it would default to incoming messages being handled by the unfiltered messages task/function.
Like client.subscribe
, you can call client.filtered_messages
as many times as you want. If you want to "update" a filter, I suggest that you simply exit the current filter and enter a new one. Does it make sense? :) If it doesn't answer your question, then please show us some code of what you've tried so far.
As there have been no more responses, I'm closing this off. If there's anything left unclear, just reopen 😉