working degrees
This commit is contained in:
parent
ba3e106a1b
commit
c4b2abcd70
2
app.js
2
app.js
@ -9,7 +9,7 @@ const menu = require('./modules/mainMenu')
|
||||
async function main() {
|
||||
lcd.clearScreen()
|
||||
await lcd.intro()
|
||||
menu.water()
|
||||
menu.home()
|
||||
|
||||
const heatingSwitch = new Gpio('17', 'in', 'both');
|
||||
const appSwitch = new Gpio('23', 'in', 'both');
|
||||
|
11
libs/lcd.js
11
libs/lcd.js
@ -40,7 +40,7 @@ module.exports = {
|
||||
lcd.setCursorSync(6, 2);
|
||||
lcd.printSync(input)
|
||||
},
|
||||
waterStatus: async (input) => {
|
||||
heatingStatus: async (input) => {
|
||||
lcd.printLineSync(2, 'Heating=')
|
||||
lcd.setCursorSync(8, 2);
|
||||
lcd.printSync(' ')
|
||||
@ -62,7 +62,14 @@ module.exports = {
|
||||
lcd.printSync(input)
|
||||
}
|
||||
},
|
||||
degrees: async () => {
|
||||
currentRoomTemp: async (temp) => {
|
||||
let icon = '°'
|
||||
temp = temp + icon
|
||||
console.log(temp)
|
||||
},
|
||||
lastSetTemp: async (temp) => {
|
||||
let icon = '°'
|
||||
temp = temp + icon
|
||||
console.log(temp)
|
||||
}
|
||||
}
|
@ -26,8 +26,6 @@ module.exports = {
|
||||
response.on('end', async function () {
|
||||
var data = JSON.parse(content);
|
||||
let heatingOn = data.heatingOn
|
||||
let currentRoomTemp = data.measuredRoomTemp
|
||||
let currentSetPoint = data.currentSetpoint
|
||||
|
||||
var time = await common.nextEvent(data.nextScheduleEventUtcTime)
|
||||
|
||||
@ -39,39 +37,45 @@ module.exports = {
|
||||
if (heatingOn === 'true') {
|
||||
globalVars.heatingOn = heatingOn
|
||||
lcd.heatingStatus('On')
|
||||
lcd.lastSetTemp(data.lastTimerSetPoint)
|
||||
lcd.currentRoomTemp(data.measuredRoomTemp)
|
||||
lcd.NextEvent(globalVars.heatingNextEvent)
|
||||
led.set('red')
|
||||
} else {
|
||||
globalVars.waterOn = waterOn
|
||||
globalVars.heatingOn = heatingOn
|
||||
lcd.heatingStatus('Off')
|
||||
led.set('blue')
|
||||
lcd.lastSetTemp(data.lastTimerSetPoint)
|
||||
lcd.currentRoomTemp(data.measuredRoomTemp)
|
||||
lcd.NextEvent(globalVars.heatingNextEvent)
|
||||
led.set('blue')
|
||||
}
|
||||
} else {
|
||||
// if (waterOn != globalVars.waterOn) {
|
||||
if (heatingOn === 'true') {
|
||||
globalVars.heatingOn = heatingOn
|
||||
lcd.heatingStatus('On')
|
||||
led.set('red')
|
||||
lcd.lastSetTemp(data.lastTimerSetPoint)
|
||||
lcd.currentRoomTemp(data.measuredRoomTemp)
|
||||
lcd.NextEvent(globalVars.heatingNextEvent)
|
||||
led.set('red')
|
||||
} else {
|
||||
globalVars.heatingOn = heatingOn
|
||||
lcd.heatingStatus('Off')
|
||||
led.set('blue')
|
||||
lcd.lastSetTemp(data.lastTimerSetPoint)
|
||||
lcd.currentRoomTemp(data.measuredRoomTemp)
|
||||
lcd.NextEvent(globalVars.waterNextEvent)
|
||||
led.set('blue')
|
||||
}
|
||||
// }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Report errors
|
||||
request.on('error', function (error) {
|
||||
led.set('green')
|
||||
lcd.heatingStatus('Error No Data')
|
||||
globalVars.heatingOn = 'error'
|
||||
});
|
||||
|
||||
request.end();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user