convert migenie temps
This commit is contained in:
parent
cf81980ee2
commit
ddf2aad2db
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user