Update main.js

This commit is contained in:
钟进 2018-09-26 14:04:11 +08:00
parent bcebdfe797
commit d585b3cf5c

27
main.js
View File

@ -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);
}
}