pimoroni / clean-shutdown

Python daemon to watch a GPIO pin and trigger a clean shutdown.
MIT License
125 stars 40 forks source link

More flexibility/robustness in the trigger pin #9

Closed guru closed 4 years ago

guru commented 7 years ago

To enable the use of the trigger pin with toggle and momentary switches, it would be good to either:

a) Record trigger pin state at startup of the script, then look for a change of state that lasts for the trigger time. (hi>lo or lo>hi) depending on a stable startup state.

b) allow more flexibility to make a high/low/change the trigger for shutdown (although this amounts to "edit the code" right now :)

I prefer A, but with polling rather than edge-change interrupts it's not ideal, but I don't think it's worse than the current state of affairs.