micropython-lib
micropython-lib copied to clipboard
umqtt.simple: add ping_response_received for ping handling
Currently when using ping the response is swallowed which makes it not particularly useful. This PR adds a flag ping_response_received to the client which is set to True if a response has been received in wait_msg. I've been using this approach in a personal project without any issues and it's not particularly invasive so I wanted to propose it as a solution to #332.
Another possible approach is to actually respond in wait_msg with an actual ping response however I'm not certain how that would interact with subscriptions and those currently using wait_msg so this approach was taken in order to not be breaking while still being useful.