Closed airdrummingfool closed 7 years ago
@airdrummingfool, thanks for your question and sorry for the delayed answer.
The current behaviour of subscribe() mimics, what homie-esp8266 is doing right now. It's not foreseen to dynamically subscribe to other topics that don't belong to your node nor to change those subscriptions during runtime.
Thanks for the reply and explanation!
There seems to be no way to add new subscriptions (using
Homie.subscribe()
) once the Homie object has been set up (withHomie.setup()
). When I try, I getBaseException: ✖ subscribe(): has to be called before setup()
. Is this a Homie convention rule, a design decision, or just a limitation of this library?I wanted to use homie-python to model a Snapcast server's clients (which have settable volume, zone, etc) as Homie device nodes. However, snapcast clients can connect and disconnect from the server at will, and new clients can show up at any time. This doesn't seem to work inside the limitations of not being able to subscribe() to new nodes later in the lifecycle of my program.