convert migenie temps

This commit is contained in:
Karl 2020-05-08 18:47:53 +01:00
parent cf81980ee2
commit ddf2aad2db
2 changed files with 26 additions and 2 deletions

View File

@ -24,5 +24,27 @@ module.exports = {
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
}
}
}
}

View File

@ -13,12 +13,14 @@ module.exports = function (app) {
const heating = response.updateData.zones[0].status
const mrt = await common.updateTemp(heating)
const on = await common.heatingOn(heating)
const csp = await common.heatMap(heating.currentSetpoint)
const lsp = await common.heatMap(heating.lastTimerSetPoint)
let heatingStatus = {
"heatingOn": JSON.stringify(on),
"measuredRoomTemp": mrt,
"currentSetpoint": JSON.stringify(heating.currentSetpoint),
"lastTimerSetPoint": JSON.stringify(heating.lastTimerSetPoint),
"currentSetpoint": csp,
"lastTimerSetPoint": lsp,
"lastTimerDurationMinutes": JSON.stringify(heating.lastTimerDurationMinutes)
}
res.json(heatingStatus)