From 5c278e9dd53fce04eda999294d3e50b6ea69344b Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 4 Sep 2024 20:48:25 -0400 Subject: [PATCH] Better logging --- src/custom_modules/functions.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/custom_modules/functions.js b/src/custom_modules/functions.js index b232f07..659286b 100644 --- a/src/custom_modules/functions.js +++ b/src/custom_modules/functions.js @@ -64,18 +64,24 @@ module.exports = { }).catch(e => console.error(e)); // Start the exhaust - this.exhaust().then(() => { + this.exhaust().then((res) => { + module.exports.log(res); // Check for vacuum - this.vacuum().then(() => { + this.vacuum().then((res) => { + module.exports.log(res); // Start the auger - this.auger().then(() => { + this.auger().then((res) => { + module.exports.log(res); resolve('Startup sequence complete.'); }).catch(e => console.error(e)); // Preheat the igniter - this.igniter().then(() => { - module.exports.sleep(config.power.start.igniterDelay).then(() => { + this.igniter().then((res) => { + module.exports.log(res); + module.exports.sleep(config.power.start.igniterDelay).then((res) => { + module.exports.log(res); // Check for fire - this.fire().then(() => { + this.fire().then((res) => { + module.exports.log(res); }).catch(e => console.error(e)); }); }).catch(e => console.error(e)); @@ -117,6 +123,14 @@ module.exports = { }).catch(e => console.error(e)); }); }, + auger() { + return new Promise(async (resolve, reject) => { + // Start auger + gpio.setPin(process.pinMap.get('auger').board, 1).then(() => { + resolve('Auger started.'); + }).catch(e => console.error(e)); + }); + }, fire() { return new Promise(async (resolve, reject) => { // Check for fire