Added simulating button press with SIGUSR2 for testing

This commit is contained in:
John Shaver 2018-12-13 23:00:09 -08:00
джерело 4c11d57a6c
коміт 29701fd944
1 змінених файлів з 5 додано та 2 видалено

@ -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