diff --git a/main.js b/main.js index 35c7b3a..ae30d5c 100644 --- a/main.js +++ b/main.js @@ -316,6 +316,33 @@ function checkObjects(options, regType, regName, regFullName, tasks, newObjects) adapter.log.info("id=" + id); + regs[i].fullId = id; + objects[id] = { + _id: regs[i].deviceId, + type: 'state', + common: { + name: regs[i].description, + role: regs[i].role, + type: 'string', + read: true, + write: true, + def: "" + }, + native: { + regType: regType, + address: regs[i].address, + ip: regs[i].ip + } + }; + + tasks.push({ + id: regs[i].deviceId, + name: 'add', + obj: objects[id] + }); + newObjects.push(id); + + } }