const http = require('http') const globalVars = require('../libs/globalVars') const led = require('../libs/led') const common = require('../libs/common') const screen = require('../libs/lcd') var requireDir = require('require-dir'); var modules = requireDir('../modules'); module.exports = { home: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('Home') await screen.clearLine(2) await screen.clearLine(3) await screen.clearLine(4) await screen.time() await modules.weather.getStatus() globalVars.weatherPolling = setInterval(() => { modules.weather.getStatus() }, 1800000); // 1800000 }, water: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('Hot Water') await screen.time() await modules.water.getStatus() globalVars.waterPolling = setInterval(() => { modules.water.getStatus() }, 60000); }, heating: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('Heating') await screen.time() await modules.heating.getStatus(globalVars.heatingPageS) globalVars.heatingPolling = setInterval(async () => { await modules.heating.getStatus(globalVars.heatingPageS) }, 60000); }, piHole: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('PiHole') await screen.time() await modules.pihole.getStatus() globalVars.piHolePolling = setInterval(() => { modules.pihole.getStatus() }, 30000); }, capitalXtra: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('Capital Xtra') await screen.time() await modules.capitalXtra.getStatus() globalVars.capitalXtraPolling = setInterval(() => { modules.capitalXtra.getStatus() }, 180000); }, hassOcto: async () => { common.clearPolling() common.clearGlobalVars() await screen.clearScreen() await screen.heading('3d Printer') await screen.time() await modules.hassOcto.getStatus() globalVars.hassOctoPolling = setInterval(() => { modules.hassOcto.getStatus() }, 30000); } }