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