Skip to content

Commit

Permalink
Merge pull request #1502 from telefonicaid/AlvaroVega-patch-1
Browse files Browse the repository at this point in the history
Update multientity-plugin_test.js and doc about explicitAttrs = true
  • Loading branch information
mapedraza authored Oct 6, 2023
2 parents 5ed79f6 + f5d39f4 commit 5562c90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ Case 2:
"explicitAttrs": true
```

just measures defined in active, static (plus conditionally TimeInstant) will be propagated to NGSI interface.
In this case, should only progress active and static attributes defined in the device or group provision (`TimeInstant` attribute
will be also included if enabled). In other words, having `"explicitAttrs":true` would prevent the IoTA creating attributes into the related
entity within the context broker from measures that are not explicitly defined in the device or group provision.

Note that attributes defined in the provision that are not receiving a measure (or having a expression defined that is resulting `null`)
will not progress (this means, the NGSI request to update the entity in the context broker is not going to include that attribute)
unless `skipValue` is defined to other value than `null`

Case 3:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"expectedAtt": {
"type": "number",
"value": 13
},
"alsoexpectedAtt": {
"value": null,
"type": "number"
}
},
{
Expand Down
10 changes: 8 additions & 2 deletions test/unit/ngsiv2/plugins/multientity-plugin_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,13 @@ const iotAgentConfig = {
expression: 'z+1'
},
{
name: 'nonexpectedAtt',
name: 'alsoexpectedAtt',
type: 'number',
expression: 'w+1',
skipValue: 'loquesea'
},
{
name: 'nonexpectedAttByDefaultSkipValue',
type: 'number',
expression: 'w+1'
},
Expand Down Expand Up @@ -600,7 +606,7 @@ const iotAgentConfig = {

describe('NGSI-v2 - Multi-entity plugin', function () {
beforeEach(function (done) {
logger.setLevel('DEBUG');
logger.setLevel('FATAL');

iotAgentLib.activate(iotAgentConfig, function () {
iotAgentLib.clearAll(function () {
Expand Down

0 comments on commit 5562c90

Please sign in to comment.