58 lines
1.8 KiB
JavaScript
58 lines
1.8 KiB
JavaScript
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);
|
|
},
|
|
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);
|
|
},
|
|
} |