Skip to content

Commit

Permalink
testing meter locating/multiplying
Browse files Browse the repository at this point in the history
  • Loading branch information
s-egge committed Sep 22, 2024
1 parent 7030057 commit a7fa279
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/dependencies/nodejs/models/meter.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ class Meter {

async upload(data) {
await DB.connect()
console.log(meterClasses)
//console.log(meterClasses)
console.log("Data: ", data)


let points = meterClasses[this.classInt]

const pointMap = {
Expand Down Expand Up @@ -271,6 +274,10 @@ class Meter {
pointMap[points[key]] = data[parseInt(key)]
}

if (this.id === 105) {
console.log(`Found meter 105. Accumulated Real: ${pointMap.accumulated_real}. Multiplied by 10: ${pointMap.accumulated_real * 10}`)
}

let time = data[0].toString().substring(1, 17) + ':00'
const timeseconds = new Date(time).getTime() / 1000 - new Date().getTimezoneOffset() * 60
try {
Expand Down

0 comments on commit a7fa279

Please sign in to comment.