Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bidirectional leftovers (reverse option) #1638

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/services/northBound/deviceProvisioningServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ function attributeToProvisioningAPIFormat(attribute) {
type: attribute.type,
expression: attribute.expression,
skipValue: attribute.skipValue,
reverse: attribute.reverse,
entity_name: attribute.entity_name,
entity_type: attribute.entity_type,
mqtt: attribute.mqtt,
Expand Down
24 changes: 0 additions & 24 deletions lib/templates/createDevice.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,30 +119,6 @@
"type": "string",
"pattern": "^([^<>;'=\"]+)+$"
},
"reverse": {
"description": "Define the attribute as bidirectional",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"object_id": {
"description": "ID of the attribute in the device",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"type": {
"description": "Type of the attribute in the target entity",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"expression": {
"description": "Optional expression for measurement transformation",
"type": "string"
}
}
}
},
"metadata": {
"description": "Attribute Metadata",
"type": "object"
Expand Down
23 changes: 0 additions & 23 deletions lib/templates/createDeviceLax.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,6 @@
"description": "Optional entity type for multientity updatess",
"type": "string",
"pattern": "^([^<>;'=\"]+)+$"
},
"reverse": {
"description": "Define the attribute as bidirectional",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"object_id": {
"description": "ID of the attribute in the device",
"type": "string"
},
"type": {
"description": "Type of the attribute in the target entity",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"expression": {
"description": "Optional expression for measurement transformation",
"type": "string"
}
}
}
}
}
}
Expand Down
26 changes: 1 addition & 25 deletions lib/templates/deviceGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,9 @@
"commands": {
"description": "list of commands of the devices",
"type": "array"
},
"reverse": {
"description": "Define the attribute as bidirectional",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"object_id": {
"description": "ID of the attribute in the device",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"type": {
"description": "Type of the attribute in the target entity",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"expression": {
"description": "Optional expression for measurement transformation",
"type": "string"
}
}
}
}
}
}
}
}
}
}
25 changes: 0 additions & 25 deletions lib/templates/queryContext.json

This file was deleted.

24 changes: 0 additions & 24 deletions lib/templates/updateDevice.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,6 @@
"type": "string",
"pattern": "^([^<>;'=\"]+)+$"
},
"reverse": {
"description": "Define the attribute as bidirectional",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"object_id": {
"description": "ID of the attribute in the device",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"type": {
"description": "Type of the attribute in the target entity",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"expression": {
"description": "Optional expression for measurement transformation",
"type": "string"
}
}
}
},
"metadata": {
"description": "Attribute Metadata",
"type": "object"
Expand Down
23 changes: 0 additions & 23 deletions lib/templates/updateDeviceLax.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,6 @@
"description": "Optional entity type for multientity updatess",
"type": "string",
"pattern": "^([^<>;'=\"]+)+$"
},
"reverse": {
"description": "Define the attribute as bidirectional",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"object_id": {
"description": "ID of the attribute in the device",
"type": "string"
},
"type": {
"description": "Type of the attribute in the target entity",
"type": "string",
"pattern": "^([^<>();'=\"]+)+$"
},
"expression": {
"description": "Optional expression for measurement transformation",
"type": "string"
}
}
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion scripts/legacy_expression_tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ The script implements expression detection and translation in the following fiel

- active.expression
- active.entity_name
- active.reverse
- attributes.expression
- attributes.entity_name
- attributes.expression
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,7 @@
{
"name":"location",
"type":"geo:point",
"expression": "${latitude}, ${longitude}",
"reverse": [
{
"object_id":"latitude",
"type": "string",
"expression": "${trim(substr(@location, indexOf(@location, \",\") + 1, length(@location)))}"
},
{
"object_id":"longitude",
"type": "string",
"expression": "${trim(substr(@location, 0, indexOf(@location, \",\")))}"
}
]
"expression": "${latitude}, ${longitude}"
}
],
"static_attributes": [],
Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,9 @@ describe('NGSI-LD - Device provisioning API: List provisioned devices', function
should.exist(body.devices[2].attributes[0].entity_name);
should.exist(body.devices[2].attributes[0].entity_type);
should.exist(body.devices[2].attributes[1].expression);
should.exist(body.devices[2].attributes[2].reverse);
body.devices[2].attributes[0].entity_name.should.equal('Higro2000');
body.devices[2].attributes[0].entity_type.should.equal('Higrometer');
body.devices[2].attributes[1].expression.should.equal('${@humidity * 20}');
body.devices[2].attributes[2].reverse.length.should.equal(2);
done();
});
});
Expand Down Expand Up @@ -245,11 +243,9 @@ describe('NGSI-LD - Device provisioning API: List provisioned devices', function
should.exist(body.attributes[0].entity_name);
should.exist(body.attributes[0].entity_type);
should.exist(body.attributes[1].expression);
should.exist(body.attributes[2].reverse);
body.attributes[0].entity_name.should.equal('Higro2000');
body.attributes[0].entity_type.should.equal('Higrometer');
body.attributes[1].expression.should.equal('${@humidity * 20}');
body.attributes[2].reverse.length.should.equal(2);
done();
});
});
Expand Down
4 changes: 0 additions & 4 deletions test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,9 @@ describe('NGSI-v2 - Device provisioning API: List provisioned devices', function
should.exist(body.devices[2].attributes[0].entity_name);
should.exist(body.devices[2].attributes[0].entity_type);
should.exist(body.devices[2].attributes[1].expression);
should.exist(body.devices[2].attributes[2].reverse);
body.devices[2].attributes[0].entity_name.should.equal('Higro2000');
body.devices[2].attributes[0].entity_type.should.equal('Higrometer');
body.devices[2].attributes[1].expression.should.equal('${@humidity * 20}');
body.devices[2].attributes[2].reverse.length.should.equal(2);
done();
});
});
Expand Down Expand Up @@ -242,11 +240,9 @@ describe('NGSI-v2 - Device provisioning API: List provisioned devices', function
should.exist(body.attributes[0].entity_name);
should.exist(body.attributes[0].entity_type);
should.exist(body.attributes[1].expression);
should.exist(body.attributes[2].reverse);
body.attributes[0].entity_name.should.equal('Higro2000');
body.attributes[0].entity_type.should.equal('Higrometer');
body.attributes[1].expression.should.equal('${@humidity * 20}');
body.attributes[2].reverse.length.should.equal(2);
done();
});
});
Expand Down
Loading