Package.json updated
getporpertie leist nun auch die Chipdaten aus prop_flux
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user