38 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-09-14 18:42:09 +01:00
const http = require('http')
const globalVars = require('../libs/globalVars')
const led = require('../libs/led')
const common = require('../libs/common')
const screen = require('../libs/lcd')
2020-09-21 21:38:46 +01:00
var requireDir = require('require-dir');
var modules = requireDir('../modules');
2020-09-14 18:42:09 +01:00
module.exports = {
home: () => {
clearInterval(globalVars.waterPolling);
screen.clearScreen()
screen.heading('Main Menu')
2020-09-21 21:38:46 +01:00
screen.time()
setInterval(screen.time, 55000)
2020-09-14 18:42:09 +01:00
},
2020-09-21 21:38:46 +01:00
water: () => {
2020-09-14 18:42:09 +01:00
screen.clearScreen()
screen.heading('Hot Water')
2020-09-21 21:38:46 +01:00
screen.time()
2020-09-14 18:42:09 +01:00
setInterval(screen.time, 55000)
2020-09-21 21:38:46 +01:00
modules.water.getStatus()
2020-09-14 18:42:09 +01:00
globalVars.waterPolling = setInterval(() => {
2020-09-21 21:38:46 +01:00
modules.water.getStatus()
}, 60000);
},
heating: () => {
screen.clearScreen()
screen.heading('Heating')
screen.time()
setInterval(screen.time, 55000)
modules.heating.getStatus()
globalVars.heatingPolling = setInterval(() => {
modules.heating.getStatus()
}, 60000);
2020-09-14 18:42:09 +01:00
}
}