convert migenie temps
This commit is contained in:
parent
cf81980ee2
commit
ddf2aad2db
@ -24,5 +24,27 @@ module.exports = {
|
|||||||
console.log('Error')
|
console.log('Error')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
heatMap: async (value) => {
|
||||||
|
value
|
||||||
|
|
||||||
|
let heatMap = [
|
||||||
|
{
|
||||||
|
"miGenie": 84,
|
||||||
|
"realTemp": 22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"miGenie": 88,
|
||||||
|
"realTemp": 23
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
for (let index = 0; index < heatMap.length; index++) {
|
||||||
|
const element = heatMap[index];
|
||||||
|
if (value === element.miGenie){
|
||||||
|
value = element.realTemp
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,12 +13,14 @@ module.exports = function (app) {
|
|||||||
const heating = response.updateData.zones[0].status
|
const heating = response.updateData.zones[0].status
|
||||||
const mrt = await common.updateTemp(heating)
|
const mrt = await common.updateTemp(heating)
|
||||||
const on = await common.heatingOn(heating)
|
const on = await common.heatingOn(heating)
|
||||||
|
const csp = await common.heatMap(heating.currentSetpoint)
|
||||||
|
const lsp = await common.heatMap(heating.lastTimerSetPoint)
|
||||||
|
|
||||||
let heatingStatus = {
|
let heatingStatus = {
|
||||||
"heatingOn": JSON.stringify(on),
|
"heatingOn": JSON.stringify(on),
|
||||||
"measuredRoomTemp": mrt,
|
"measuredRoomTemp": mrt,
|
||||||
"currentSetpoint": JSON.stringify(heating.currentSetpoint),
|
"currentSetpoint": csp,
|
||||||
"lastTimerSetPoint": JSON.stringify(heating.lastTimerSetPoint),
|
"lastTimerSetPoint": lsp,
|
||||||
"lastTimerDurationMinutes": JSON.stringify(heating.lastTimerDurationMinutes)
|
"lastTimerDurationMinutes": JSON.stringify(heating.lastTimerDurationMinutes)
|
||||||
}
|
}
|
||||||
res.json(heatingStatus)
|
res.json(heatingStatus)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user