Fix call for init

This commit is contained in:
Skylar Grant 2024-09-02 12:11:51 -04:00
parent 49d855e306
commit 0a90a93269
2 changed files with 4 additions and 4 deletions

View File

@ -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));

View File

@ -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));
});