@teguruma
tut es nicht
// Kopieren von Datenpunkten nach 0_userdata.0
// Pfade anpassen !
const pathSrc = 'javascript.0.'; // abschließenden Punkt angeben
const pathDst = '0_userdata.0.';
const idsSrc = $(pathSrc + '*');
idsSrc.each(function(id, i) { // Schleife über alle Datenpunkte im Pfad
let idDst = pathDst + id.substring(pathSrc.length);
if(existsObject(idDst)) log('Datenpunkt ' + idDst + ' existiert bereits !', 'warn');
else {
let obj = getObject(id);
setObject(idDst, obj, function (err) {
if (err) log('Cannot write object: ' + err)
else {
let init = null;
if(existsState(id)) init = getState(id).val;
else {
let common = obj.common;
if(common.def === undefined) {
if(common.type === 'number') init = 0;
if(common.type === 'boolean') init = false;
if(common.type === 'string') init = '';
if(common.type === 'array') init = [];
} else init = common.def;
}
setStateDelayed(idDst, init, true, 20 * i + 50);
}
});
}
});
hab ich auch mal hier wo geklaut