Boop
This commit is contained in:
parent
4e4bf9f7ca
commit
a0b0d16c73
@ -145,5 +145,12 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handlers: {
|
||||||
|
stateChange(change) {
|
||||||
|
gpio.togglePin(pinMap[change.name].board).then(() => {
|
||||||
|
console.log(`Pin ${config.states[change.name].pin} set to ${change.on}`);
|
||||||
|
}).catch(e => console.error(e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,5 @@ setInterval(() => {
|
|||||||
|
|
||||||
comms.on('stateChange', (change) => {
|
comms.on('stateChange', (change) => {
|
||||||
console.log(`State change detected: ${change.name}`);
|
console.log(`State change detected: ${change.name}`);
|
||||||
gpio.togglePin(config.states[change.name].board).then(() => {
|
fn.handlers.stateChange(change);
|
||||||
console.log(`Pin ${config.states[change.name].pin} set to ${change.on}`);
|
|
||||||
}).catch(e => console.error(e));
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user