Fix import of config and pins

This commit is contained in:
Skylar Grant 2024-08-21 21:19:46 -04:00
parent 24470fe6f2
commit ccc84173cb

View File

@ -1,6 +1,6 @@
// Import modules
const gpio = require('./custom_modules/VoidGPIO.js');
const { pins } = require('./custom_modules/config.json');
const config = require('./custom_modules/config.json');
const fn = require('./custom_modules/functions.js');
const { State, Communicator } = require('./custom_modules/HestiaClasses.js');
@ -13,7 +13,7 @@ fn.gpio.debugInit();
// Sensor detection loop
setInterval(() => {
for (const pin of pins) {
for (const pin of config.pins) {
if (pin.mode === 'IN') {
gpio.readPin(pin.board, (err, state) => {
if (err) throw err;