Added simulating button press with SIGUSR2 for testing
This commit is contained in:
parent
4c11d57a6c
commit
29701fd944
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue