Closed jeberhardt closed 7 years ago
You might check out the daemon code, add an optional hook to a shutdown script, and send us a patch? best h
On 28 June 2016 at 18:45, James Eberhardt notifications@github.com wrote:
I think the best way to set the delay for powering on is just before the device powers off. The reason for powering off could be for several different reasons: -- user presses power button -- Mopi initiates power off because of a set delay -- Mopi initiates power off because battery is dying -- command line tells RPi to power off
My question is: what's the recommended way to execute a python script (or other type of script) immediately before shutdown?
What I would like to do is read a JSON file that has the schedule for when the device should turn on, set the delay using the mopiapi, then continue powering the RPi down.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hamishcunningham/pi-tronics/issues/85, or mute the thread https://github.com/notifications/unsubscribe/AEMQlEPJaIRbmj8GPqa74Bc3_-sOgcGHks5qQV3OgaJpZM4JAWs0 .
Hamish Cunningham Professor of Computer Science, University of Sheffield, UK
BBC Radio Sheffield say I'm a fish poo boffin (http://www.bbc.co.uk/programmes/p03v9nyv 2 hours 37 mins in; also on vid: http://bbc.in/20x2C5J & scroll down a little)
Phone: +44 7740 149 842 hamish@gate.ac.uk https://twitter.com/@HCunningham https://hamish.gate.ac.uk https://wegrow.social https://wegrow.social/ https://gate.ac.uk https://pi.gate.ac.uk http://www.dcs.shef.ac.uk/cgi-bin/makeperson?H.Cunningham
I think the best way to set the delay for powering on is just before the device powers off. The reason for powering off could be for several different reasons: -- user presses power button -- Mopi initiates power off because of a set delay -- Mopi initiates power off because battery is dying -- command line tells RPi to power off
My question is: what's the recommended way to execute a python script (or other type of script) immediately before shutdown?
What I would like to do is read a JSON file that has the schedule for when the device should turn on, set the delay using the mopiapi, then continue powering the RPi down.