Added simulating button press with SIGUSR2 for testing

This commit is contained in:
John Shaver 2018-12-13 23:00:09 -08:00
parent 4c11d57a6c
commit 29701fd944

View file

@ -45,11 +45,14 @@ let renderInterval = setInterval(render, 50);
let debugInterval = DEBUG && setInterval(logLEDStatus, 2000); let debugInterval = DEBUG && setInterval(logLEDStatus, 2000);
//******** //********
napButton.on("alert", startNap); napButton.on("alert", startNap);
DEBUG && process.on('SIGUSR2', () => {
console.debug("Simulating button press!");
startNap();
});
function startNap(level, tick) { function startNap(level, tick) {
console.log("Button alert!:"); console.log("Button alert recieved. Starting nap time!");
state = { ...state, state = { ...state,
napTime: true, napTime: true,
napEnd: Date.now() + NAP_DURATION napEnd: Date.now() + NAP_DURATION