From d585b3cf5c1e5bda219129e395e11593b02b9344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E8=BF=9B?= Date: Wed, 26 Sep 2018 14:04:11 +0800 Subject: [PATCH] Update main.js --- main.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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); + + } }