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