Skip to content

Commit

Permalink
Merge pull request telefonicaid#523 from jason-fox/feature/hidden
Browse files Browse the repository at this point in the history
Remove preprocess stripping of explicitAttrs
  • Loading branch information
mapedraza authored Dec 23, 2021
2 parents 8b4d53e + 3aff912 commit 9551d43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- FIX: provide device type to findConfiguration to achieve a better group match in getEffectiveApiKey (iota-node-lib#1155)
- FIX: update polling when device is updated by adding endpoint (needs iota-node-lib >= 2.19) (twin for iota-json#602)
- FIX: Remove preprocess stripping of explicitAttrs (iotagent-node-lib#1151)
- FIX: Add graceful shutdown listening to SIGINT (#524)
40 changes: 7 additions & 33 deletions lib/commonBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,6 @@ function manageConfigurationRequest(apiKey, deviceId, device, objMessage) {
/* eslint-disable-next-line no-unused-vars */
function processMeasureGroup(device, apikey, previous, current, index) {
const values = [];

function checkAttributes(k) {
if (device && device.active) {
for (let j = 0; j < device.active.length; j++) {
const objectId = 'object_id';
const name = 'name';
if (k === 'TimeInstant' || device.active[j][objectId] === k || device.active[j][name] === k) {
return true;
}
}
}
return false;
}

if (current.command) {
previous.push(
iotAgentLib.setCommandResult.bind(
Expand All @@ -146,25 +132,13 @@ function processMeasureGroup(device, apikey, previous, current, index) {
)
);
} else {
if (device.explicitAttrs) {
for (const i in current) {
if (current.hasOwnProperty(i) && checkAttributes(i)) {
values.push({
name: i,
type: guessType(i, device),
value: current[i]
});
}
}
} else {
for (const k in current) {
if (current.hasOwnProperty(k)) {
values.push({
name: k,
type: guessType(k, device),
value: current[k]
});
}
for (const k in current) {
if (current.hasOwnProperty(k)) {
values.push({
name: k,
type: guessType(k, device),
value: current[k]
});
}
}

Expand Down

0 comments on commit 9551d43

Please sign in to comment.