Package.json updated

getporpertie leist nun auch die Chipdaten aus prop_flux
This commit is contained in:
2025-09-15 16:11:13 +00:00
parent 41ef7a06b2
commit 75ccb0b8ea
7 changed files with 4944 additions and 1830 deletions
+7 -1
View File
@@ -5,14 +5,20 @@ import {returnOnError} from "../utilities/reporterror.js"
import checkParams from "../utilities/checkparams.js"
let readProperties = mongo.readProperties
let readChipData = mongo.readChipData
// Read properties for sensorid and properties for all other sensors on same location
export const getOneProperty = async (params) => {
let properties = {props: {}, err: null}
let properties = {err: null, props: {}, chip: {}}
let {opts, err} = checkParams(params, {mandatory:[{name:'sensorid', type: 'int'}], optional:[]})
if (err) {
return returnOnError(properties, err, getOneProperty.name)
}
// read 'chip'-data (special for noise sensors)
const chipdata = await readChipData(opts.sensorid)
if (chipdata.err == undefined) {
properties.chip = chipdata
}
let sensorEntries = [];
try {
let pp = await readProperties({sid: opts.sensorid}); // read for given sensorID