Skip to content

Commit

Permalink
test: example wago test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
biancode committed Jun 2, 2020
1 parent fb4618a commit 6bb53a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion example/read-device.js
Expand Up @@ -334,11 +334,18 @@ function parseDeviceObject(address, obj, parent, supportsMultiple, callback) {
if (debug) {
console.log('START parseDeviceObject: ' + JSON.stringify(parent) + ' : ' + JSON.stringify(obj));
}

if(!obj) {
console.log('object not valid on parse device object');
return;
}

if (!obj.values || !Array.isArray(obj.values)) {
console.log('No device or invalid response');
callback({'ERROR': 'No device or invalid response'});
return;
}

let cbCount = 0;
let objDef = {};

Expand Down Expand Up @@ -478,7 +485,7 @@ bacnetClient.on('iAm', (device) => {
knownDevices.push(deviceId);

const propertyList = [];
proSubSet.forEach(item => {
propSubSet.forEach(item => {
propertyList.push({id: item});
});

Expand Down

0 comments on commit 6bb53a3

Please sign in to comment.