Browse Source

Added simulating button press with SIGUSR2 for testing

button
John Shaver 1 year ago
parent
commit
29701fd944
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      runSchedule.js

+ 5
- 2
runSchedule.js View File

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

Loading…
Cancel
Save