From f0ad09fadd38bf5b780b43247640e803340c8ff8 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 18 Aug 2024 13:50:54 -0400 Subject: [PATCH] Try not returning but calling? --- src/custom_modules/VoidGPIO.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/custom_modules/VoidGPIO.js b/src/custom_modules/VoidGPIO.js index 5920ded..9cb97d4 100644 --- a/src/custom_modules/VoidGPIO.js +++ b/src/custom_modules/VoidGPIO.js @@ -47,18 +47,18 @@ module.exports = { togglePin(pin, callback) { exec(`python3 src/python/gpio_interface.py toggle ${pin}`, (error, stdout, stderr) => { if (error) { - return callback(error); + callback(error); } if (stderr) { - return callback(new Error(stderr)); + callback(new Error(stderr)); } }); }, // Calls the GPIO Interface script to read a pin's state readPin(pin, callback) { exec(`python3 src/python/gpio_interface.py read ${pin}`, (error, stdout, stderr) => { - if (error) return callback(error); - if (stderr) return callback(new Error(stderr)); + if (error) callback(error); + if (stderr) callback(new Error(stderr)); callback(null, stdout.trim()); }); }, @@ -66,10 +66,10 @@ module.exports = { setPin(pin, state, callback) { exec(`python3 src/python/gpio_interface.py set ${pin} ${state}`, (error, stdout, stderr) => { if (error) { - return callback(error); + callback(error); } if (stderr) { - return callback(new Error(stderr)); + callback(new Error(stderr)); } callback(null); })