From 29701fd944867f971132544591dad263a162a07e Mon Sep 17 00:00:00 2001 From: John Shaver Date: Thu, 13 Dec 2018 23:00:09 -0800 Subject: [PATCH] Added simulating button press with SIGUSR2 for testing --- runSchedule.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runSchedule.js b/runSchedule.js index 3bcbf81..760d428 100644 --- a/runSchedule.js +++ b/runSchedule.js @@ -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