peterhinch / micropython-mqtt

A 'resilient' asynchronous MQTT driver. Recovers from WiFi and broker outages.
MIT License
550 stars 117 forks source link

[Feature Questions] Unsubscribe, recognize retained messages #6

Closed kevinkk525 closed 5 years ago

kevinkk525 commented 5 years ago

Hello Peter,

I implemented the functionality for "unsubscribe" into my fork. Additionaly I added the possibility to recognize retained publications and pass that information on to the "subs_cb" callback. Because of this, my repository is not a drop-in replacement anymore as it requires the "subs_cb" to accept 3 args (topic,msg,retained).

I'd be happy if you could take a look at the changes of the commit adding the functionality. I'm not sure if I missed something but it definitely works as expected. I'm also writing, because my "experimental" fork is mentioned in your README and with these changes you might be thinking differently about how to mention my fork or if you want to mention it at all, given that the functionality and drop-in ability has changed.

peterhinch commented 5 years ago

Hi Kevin, thank you for your contributions. In our previous communications I said I was waiting on a new hardware platform before recommencing work on MQTT. Since then Damien announced it as the Pyboard D series which has onboard WiFi.

My plan (when I get a sample) is as follows:

To avoid repeating work I don't plan to start this until the Pyboard D is in my hands.

kevinkk525 commented 5 years ago

I completely understand, thanks a lot for your efforts! Looking forward to the Pyboard D as well :)