seee prev. commit

This commit is contained in:
rxf
2023-06-27 17:14:18 +02:00
parent f5fba41a50
commit ecdcded663
7 changed files with 113 additions and 149 deletions
+10 -9
View File
@@ -8,12 +8,12 @@ import {csv2Json} from "../utilities/csv2json.js"
import checkParams from "../utilities/checkparams.js"
import {getOneProperty} from "./getproperties.js"
import {getNoiseData} from "../sensorspecials/noise.js"
import {getRadioData} from "../sensorspecials/radioact.js"
import {getgeigerData} from "../sensorspecials/geigeract.js"
// Possible params for the different sensor types
const noiseParams = [
{name:'data', type: 'string', default: 'live'},
{name: 'span', type: 'int', default: ''},
{name: 'span', type: 'int', default: 1},
{name: 'daystart', type: 'bool', default: null},
{name: 'peak', type: 'int', default: 70},
{name: 'since', type: 'date', default: '1900-01-01T00:00:00Z'},
@@ -27,11 +27,11 @@ const noiseParams = [
]
const thpParams = []
const pmParams = []
const radioParams = [
const geigerParams = [
{name: 'what', type: 'string', default: 'day'},
{name: 'span', type: 'int', default: ''},
{name: 'span', type: 'int', default: 1},
{name: 'daystart', type: 'bool', default: null},
{name: 'avg', type: 'int', default: 10},
{name: 'avg', type: 'int', default: 1},
{name: 'since', type: 'date', default: '1900-01-01T00:00:00Z'},
{name: 'box', type: 'array', default: null},
{name: 'out', type: 'string', default: ''},
@@ -39,7 +39,8 @@ const radioParams = [
{name: 'long', type: 'bool', default: false},
{name: 'sort', type: 'int', default: 1},
{name: 'last_seen', type: 'date', default: '1900-01-01T00:00:00Z'},
{name: 'datetime', type: 'date', default: null}
{name: 'datetime', type: 'date', default: null},
{name: 'mooving', type: 'bool', default: false},
]
// >>>>>>>>>>>>>>>>>>>>> DUMMIES
@@ -56,7 +57,7 @@ const sensorTypeTable = [
{ typ: 'thp', possibleParams: thpParams, func: getThpData},
{ typ: 'noise', possibleParams: noiseParams, func: getNoiseData},
{ typ: 'pm', possibleParams: pmParams, func: getPmData},
{ typ: 'radioactivity', possiblePramas: radioParams, func: getRadioData}
{ typ: 'radioactivity', possibleParams: geigerParams, func: getgeigerData}
]
/* Units:
@@ -149,8 +150,8 @@ export async function getSensorData(params) {
// export const getActData = async (opts) => {
export async function getActData(opts) {
let retI = await influx.fetchActData(opts)
retI.mongo = false
// let retI = await influx.fetchActData(opts)
// retI.mongo = false
let retM = await mongo.fetchActData(opts)
retM.mongo = true
return retM