auf aktuelle esprimo-Version updated
This commit is contained in:
7
parse.js
7
parse.js
@@ -146,7 +146,7 @@ const buildNewEntry = (item, typ, dt, now) => {
|
||||
const types = {
|
||||
P1: 'pm', P2: 'pm', P0: 'pm',
|
||||
temperature: 'thp', humidity: 'thp', pressure: 'thp',
|
||||
noise_LAeq: 'noise', noise_LA_max: 'noise',
|
||||
noise_LAeq: 'noise', noise_LA_max: 'noise', noise_LA_min: 'noise',
|
||||
counts_per_minute: 'radioactivity',
|
||||
lat: 'gps'
|
||||
};
|
||||
@@ -182,6 +182,9 @@ export const constructDBaseEntries = async (client, body, args) => {
|
||||
if (typ === 'unknown') { // extract measurement type
|
||||
typ = getType(vtyp)
|
||||
}
|
||||
if(typ === 'noise') {
|
||||
vtyp = vtyp.slice(6)
|
||||
}
|
||||
let val = v.value; // and value
|
||||
let x
|
||||
try {
|
||||
@@ -196,7 +199,7 @@ export const constructDBaseEntries = async (client, body, args) => {
|
||||
values[vtyp] = x
|
||||
ival += `${vtyp}=${x},`
|
||||
// if noise sensor precalculate pow10
|
||||
if (vtyp == 'noise_LAeq') {
|
||||
if (vtyp == 'LAeq') {
|
||||
let e10 = Math.pow(10, x / 10)
|
||||
values.E10tel_eq = e10
|
||||
ival += `E10tel_eq=${e10},`
|
||||
|
||||
Reference in New Issue
Block a user