waterstatus payload

This commit is contained in:
Karl 2020-05-08 12:51:45 +01:00
parent 7e68b0b9f3
commit cf81980ee2

View File

@ -1,4 +1,5 @@
const post = require('../lib/post')
const common = require('../lib/common')
module.exports = function (app) {
app.get("/water", async function (req, res, next) {
@ -10,7 +11,15 @@ module.exports = function (app) {
app.get("/water/status", async function (req, res, next) {
const response = await post.postRequest()
const water = response.updateData.zones[1].status
res.json(water)
const on = await common.heatingOn(water)
let waterStatus = {
"waterOn": JSON.stringify(on),
"currentSetpoint": JSON.stringify(water.currentSetpoint),
"lastTimerSetPoint": JSON.stringify(water.lastTimerSetPoint),
"lastTimerDurationMinutes": JSON.stringify(water.lastTimerDurationMinutes)
}
res.json(waterStatus)
});
app.get("/water/config", async function (req, res, next) {