working temp
This commit is contained in:
parent
939e853ea0
commit
7e68b0b9f3
@ -3,8 +3,8 @@ module.exports = {
|
||||
updateTemp: async (heating) => {
|
||||
try {
|
||||
let mrt = String(heating.measuredRoomTemp)
|
||||
mrt = mrt.split(/(?=(?:..)*$)/)
|
||||
mrt = parseFloat(mrt[1] + "." + mrt[0])
|
||||
mrt = mrt.match(new RegExp('.{1,' + 2 + '}', 'g'));
|
||||
mrt = mrt[0] + "." + mrt[1]
|
||||
return mrt
|
||||
} catch (error) {
|
||||
console.log('Error')
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -419,6 +419,11 @@
|
||||
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
|
||||
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ=="
|
||||
},
|
||||
"numeral": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz",
|
||||
"integrity": "sha1-StCAk21EPCVhrtnyGX7//iX05QY="
|
||||
},
|
||||
"on-finished": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||
|
@ -17,5 +17,5 @@
|
||||
"express": "^4.17.1",
|
||||
"fs": "0.0.1-security",
|
||||
"got": "^11.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,12 @@ module.exports = function (app) {
|
||||
const on = await common.heatingOn(heating)
|
||||
|
||||
let heatingStatus = {
|
||||
"heatingOn": on,
|
||||
"heatingOn": JSON.stringify(on),
|
||||
"measuredRoomTemp": mrt,
|
||||
"currentSetpoint": heating.currentSetpoint,
|
||||
"lastTimerSetPoint": heating.lastTimerSetPoint,
|
||||
"lastTimerDurationMinutes": heating.lastTimerDurationMinutes
|
||||
"currentSetpoint": JSON.stringify(heating.currentSetpoint),
|
||||
"lastTimerSetPoint": JSON.stringify(heating.lastTimerSetPoint),
|
||||
"lastTimerDurationMinutes": JSON.stringify(heating.lastTimerDurationMinutes)
|
||||
}
|
||||
|
||||
res.json(heatingStatus)
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user