From 0a90a93269fe12c81cbbd945b8a9068c541f802d Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 2 Sep 2024 12:11:51 -0400 Subject: [PATCH] Fix call for init --- src/custom_modules/functions.js | 4 ++-- src/main.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/custom_modules/functions.js b/src/custom_modules/functions.js index 80beec0..a0ef260 100644 --- a/src/custom_modules/functions.js +++ b/src/custom_modules/functions.js @@ -54,12 +54,12 @@ module.exports = { }, power: { start: { - init() { + init(communicator, state) { return new Promise(async (resolve, reject) => { // TODO: Check pin states? // Set pins to default states - module.exports.gpio.setDefaults().then(changes => { + module.exports.gpio.setDefaults(communicator, state).then(changes => { module.exports.log(changes); }).catch(e => console.error(e)); diff --git a/src/main.js b/src/main.js index 396f2f1..7c0616d 100644 --- a/src/main.js +++ b/src/main.js @@ -34,10 +34,10 @@ comms.on('stateChange', (oldState, state) => { comms.on('startup', () => { console.log(`Startup detected.`); - fn.power.start.init().catch(e => console.error(e)); + fn.power.start.init(comms, psState).catch(e => console.error(e)); }); comms.on('shutdown', () => { console.log(`Shutdown detected.`); - fn.power.stop.init().catch(e => console.error(e)); + fn.power.stop.init(comms, psState).catch(e => console.error(e)); }); \ No newline at end of file