Fix call for init
This commit is contained in:
parent
49d855e306
commit
0a90a93269
@ -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));
|
||||
|
||||
|
@ -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));
|
||||
});
|
Loading…
Reference in New Issue
Block a user