I’m using Flask on a Raspberry Pi for an IoT application.
My problem is, that I need to cleanly close the connection to my external device before the application is shutdown or restarted by the Flask auto-reloader.
Is there any callback / handler / event / etc. I can use for a clean shutdown? (that also works with the auto-reloader)