Closed psyciknz closed 5 years ago
Hi @psyciknz!
I don't know if @jalmeroth will add something more later, but here is my answer:
homie-python spans a thread for the mqtt connection and the callbacks, so you don't have to worry about sleeping too much time. As Arduino is not able to execute more than one thread, its library needs the homie.loop() function to be called to ensure that the underground tasks are being executed, but here we don't have that problem. Things are a little bit easier in a multiprocess environment :wink:
Enjoy the library and if you have any suggestion or improvement, don't hesitate to open a new issue.
Best regards,
Aitor
Thanks for your explanation, @bodiroga! 👍
In the arduino version of homie, it calls homie.loop to go to sleep.
Here in homie.python, we're using time.sleep(#).
I currently have mine set a 1 as per examples, but for a fan control script, what would happen if this was much higher? The homie.loop includes looping, sleep and keeping a mqttc client awake for callbacks.