Initial monorepo: readin, sensorapi, noise (Node22, npm ci, axios1.x, i18next-fs-backend)

This commit is contained in:
rxf
2026-07-25 11:35:41 +00:00
commit 2df1f79617
97 changed files with 13547 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
// Gibt für eine Property-Anfrage immer den 140er Sensor zurück
// rxf 2022-05-25
export const readProperties = async (query, limit = 0) => {
let ret = {error: false}
if ("sid" in query) { // if sid is given, read property for sid
ret.values = {
"_id" : 140,
"location_id" : 65,
"name" : "SDS011",
"since" : "2021-04-21T09:44:12.888Z",
"location" : [
{
"loc" :
{
"type" : "Point",
"coordinates" : [ 9.16, 48.778 ]
},
"id" : 65,
"altitude" : 282,
"since" : "2021-04-21T09:44:12.888Z",
"address" : { },
"exact_loc" : 0,
"indoor" : 0
}
]
}
} else { // otherwise read props corresponding to query
ret.values = [
{
"_id" : 140,
"location_id" : 65,
"name" : "SDS011",
"since" : "2021-04-21T09:44:12.888Z",
"location" : [
{
"loc" :
{
"type" : "Point",
"coordinates" : [ 9.16, 48.778 ]
},
"id" : 65,
"altitude" : 282,
"since" : "2021-04-21T09:44:12.888Z",
"address" : { },
"exact_loc" : 0,
"indoor" : 0
}
]
},{
"_id" : 141,
"location_id" : 65,
"name" : "BME280",
"since" : "2021-04-21T09:44:12.888Z",
"location" : [
{
"loc" :
{
"type" : "Point",
"coordinates" : [ 9.16, 48.778 ]
},
"id" : 65,
"altitude" : 282,
"since" : "2021-04-21T09:44:12.888Z",
"address" : { },
"exact_loc" : 0,
"indoor" : 0
}
]
}
]
}
return ret
}