waterstatus payload
This commit is contained in:
parent
7e68b0b9f3
commit
cf81980ee2
@ -1,4 +1,5 @@
|
|||||||
const post = require('../lib/post')
|
const post = require('../lib/post')
|
||||||
|
const common = require('../lib/common')
|
||||||
|
|
||||||
module.exports = function (app) {
|
module.exports = function (app) {
|
||||||
app.get("/water", async function (req, res, next) {
|
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) {
|
app.get("/water/status", async function (req, res, next) {
|
||||||
const response = await post.postRequest()
|
const response = await post.postRequest()
|
||||||
const water = response.updateData.zones[1].status
|
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) {
|
app.get("/water/config", async function (req, res, next) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user