hestia/main.js

34 lines
797 B
JavaScript
Raw Normal View History

2022-12-03 23:10:31 +00:00
// Custom functions module to keep main script clean
const fn = require('./functions').functions;
2022-11-27 01:50:20 +00:00
2022-12-03 23:10:31 +00:00
// Environment Variables Importing
const dotenv = require('dotenv').config();
2022-11-27 03:14:18 +00:00
// TODO Add logic for other sensors
while (true) {
2022-12-03 23:13:32 +00:00
main();
2022-11-27 00:33:33 +00:00
}
2022-11-27 01:56:04 +00:00
// Main function, turns the auger on, sleeps for the time given in environment variables, then turns the auger off, sleeps, repeats.
async function main() {
fn.files.check();
switch (fn.files.check()) {
case "pause":
fn.commands.pause();
break;
case "reload":
fn.commands.reload();
break;
case "quit":
fn.commands.quit();
break;
case "none":
fn.auger.cycle();
break;
default:
break;
}
2022-11-27 00:49:07 +00:00
}