Added simulating button press with SIGUSR2 for testing

Este commit está contenido en:
John Shaver 2018-12-13 23:00:09 -08:00
padre 4c11d57a6c
commit 29701fd944
Se han modificado 1 ficheros con 5 adiciones y 2 borrados

Ver fichero

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