auf aktuelle esprimo-Version updated

This commit is contained in:
rxf
2023-12-18 17:23:59 +01:00
parent 4f19f9973a
commit 6d1d60a9c1
16 changed files with 102 additions and 964 deletions

View File

@@ -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},`