fix exhaust to blower in db

This commit is contained in:
Skylar Grant 2023-11-17 10:24:59 -05:00
parent ec50ed3516
commit ceab174d04

View File

@ -196,14 +196,14 @@ const functions = {
}).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`)); }).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`));
}, },
exhaustOn() { exhaustOn() {
const enableExhaustQuery = "UPDATE status SET value = 1 WHERE key = 'exhaust'"; const enableExhaustQuery = "UPDATE status SET value = 1 WHERE key = 'blower'";
dbfn.run(enableExhaustQuery).then(res => { dbfn.run(enableExhaustQuery).then(res => {
console.log(`[${(Date.now() - config.timestamps.procStart) / 1000}] I: Exhaust enabled.`); console.log(`[${(Date.now() - config.timestamps.procStart) / 1000}] I: Exhaust enabled.`);
return; return;
}).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`)); }).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`));
}, },
exhaustOff() { exhaustOff() {
const disableExhaustQuery = "UPDATE status SET value = 0 WHERE key = 'exhaust'"; const disableExhaustQuery = "UPDATE status SET value = 0 WHERE key = 'blower'";
dbfn.run(disableExhaustQuery).then(res => { dbfn.run(disableExhaustQuery).then(res => {
if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res.status}`); if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res.status}`);
console.log(`[${(Date.now() - config.timestamps.procStart) / 1000}] I: Exhaust disabled.`); console.log(`[${(Date.now() - config.timestamps.procStart) / 1000}] I: Exhaust disabled.`);