From d1ac00f73720a1a196808812e6bad9b4f9cd7a44 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 18 Dec 2022 12:47:03 -0500 Subject: [PATCH] Adding sensor test calls --- main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index b3d2c1e..f2bd8a7 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,6 @@ /* Pellet Stove Control Panel * Written by Skylar Grant - * v0.2.0 + * v0.2 * * TODO: * Add logic for other sensors @@ -128,11 +128,20 @@ function statusCheck(fn, gpio) { main(fn, gpio); }); + // Check the vacuum switch, if the test returns true, the vacuum is sensed + // if it returns false, we will initiate a shutdown fn.tests.vacuum(gpio).then(status => { if (!status) { fn.commands.shutdown(gpio); } - }) + }); + + // Check the Proof of Fire Switch + fn.tests.pof(gpio).then(status => { + // If the igniter has finished running and no proof of fire is seen, shutdown the stove + // TODO Shutdown will handle checks if it's being called repeatedly. + if (config.status.igniterFinished && (!status)) fn.commands.shutdown(gpio); + }); // blowerOffDelay() returns true only if the blower shutdown has // been initiated AND the specified cooldown time has passed