Update main.js

This commit is contained in:
钟进 2018-11-08 01:47:48 +08:00
parent 173f776efe
commit 35105938aa

View File

@ -853,17 +853,14 @@ function parseConfig(callback) {
}*/
// ------------- create states and objects ----------------------------
checkObjects(adapter.config, 'yz', 'yz', 'yz', tasks, newObjects);
checkObjects(adapter.config, 'disInputs', 'discreteInputs', 'Discrete inputs', tasks, newObjects);
checkObjects(adapter.config, 'coils', 'coils', 'Coils', tasks, newObjects);
checkObjects(adapter.config, 'inputRegs', 'inputRegisters', 'Input registers', tasks, newObjects);
checkObjects(adapter.config, 'holdingRegs', 'holdingRegisters', 'Holding registers', tasks, newObjects);
if (options.config.slave) {
device.disInputs.fullIds = adapter.config.disInputs .filter(e => e.deviceId === deviceId).map(e => e.fullId);
device.coils.fullIds = adapter.config.coils .filter(e => e.deviceId === deviceId).map(e => e.fullId);
device.inputRegs.fullIds = adapter.config.inputRegs .filter(e => e.deviceId === deviceId).map(e => e.fullId);
device.holdingRegs.fullIds = adapter.config.holdingRegs.filter(e => e.deviceId === deviceId).map(e => e.fullId);
}
/*for (i = 0; regs.length > i; i++) {
id = adapter.namespace + '.' + regs[i].id;