Hello coders :
I'm developing an add-on (including a RasPi shield) for OctoPrint. This shield embeds a microcontroller and manages power (among other features).
I'd like to know if OctoPrint can "hook" the OctoPi/Linux shutdown procedure so it could ask the user a confirmation before shutting down and powering off after pushing a button. I'd like to make the hardware push button act like the "Shutdown system" option in the system menu.
At this time the PCBs are populated. Everything is working fine on the bench. I routed a "reserved" trace between the MC (on the shield), and the Pi GPIO. So it can communicate with the Pi and OctoPrint. But I'd prefer an OS+Octoprint level solution.
The question is ; could OctoPrint hook a "shutdown procedure" ?
I didn't find an answer reading the OctoPrint APIs...
(not asking for a snippet, but I won't close my eyes and my ears )