diff --git a/lib/services/northBound/deviceProvisioningServer.js b/lib/services/northBound/deviceProvisioningServer.js index 510b9802f..2099cba45 100644 --- a/lib/services/northBound/deviceProvisioningServer.js +++ b/lib/services/northBound/deviceProvisioningServer.js @@ -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, diff --git a/lib/templates/createDevice.json b/lib/templates/createDevice.json index 07110b59c..b6929c3ee 100644 --- a/lib/templates/createDevice.json +++ b/lib/templates/createDevice.json @@ -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" diff --git a/lib/templates/createDeviceLax.json b/lib/templates/createDeviceLax.json index 89d666195..a5232f46e 100644 --- a/lib/templates/createDeviceLax.json +++ b/lib/templates/createDeviceLax.json @@ -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" - } - } - } } } } diff --git a/lib/templates/deviceGroup.json b/lib/templates/deviceGroup.json index 190e305b0..cb9fb513c 100644 --- a/lib/templates/deviceGroup.json +++ b/lib/templates/deviceGroup.json @@ -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" - } - } - } } } } } - } + } } diff --git a/lib/templates/queryContext.json b/lib/templates/queryContext.json deleted file mode 100644 index e91e62569..000000000 --- a/lib/templates/queryContext.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "properties": { - "entities": { - "description": "The objects the request is applied to.", - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "required": true - }, - "isPattern": { - "type": "string" - }, - "id": { - "type": "string", - "required": true - } - } - }, - "required": true - } - } -} \ No newline at end of file diff --git a/lib/templates/updateDevice.json b/lib/templates/updateDevice.json index 7689bd500..3b6c0835a 100644 --- a/lib/templates/updateDevice.json +++ b/lib/templates/updateDevice.json @@ -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" diff --git a/lib/templates/updateDeviceLax.json b/lib/templates/updateDeviceLax.json index fcc292a0c..a40bf59ed 100644 --- a/lib/templates/updateDeviceLax.json +++ b/lib/templates/updateDeviceLax.json @@ -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" - } - } - } } } } diff --git a/scripts/legacy_expression_tool/README.md b/scripts/legacy_expression_tool/README.md index bce38c25c..d99ae26cb 100644 --- a/scripts/legacy_expression_tool/README.md +++ b/scripts/legacy_expression_tool/README.md @@ -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 diff --git a/test/unit/examples/deviceProvisioningRequests/provisionBidirectionalDevice.json b/test/unit/examples/deviceProvisioningRequests/provisionBidirectionalDevice.json deleted file mode 100644 index 28dd1678b..000000000 --- a/test/unit/examples/deviceProvisioningRequests/provisionBidirectionalDevice.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "devices": [ - { - "device_id": "Light1", - "protocol": "GENERIC_PROTO", - "entity_name": "TheFirstLight", - "entity_type": "TheLightType", - "timezone": "America/Santiago", - "endpoint": "http://fakedEndpoint:1234", - "transport": "MQTT", - "attributes": [ - { - "name":"location", - "type":"geo:point", - "expression": "latitude,longitude", - "reverse": [ - { - "object_id":"latitude", - "type": "Number", - "expression": "location | split(', ')[1] | parsefloat()" - }, - { - "object_id":"longitude", - "type": "Number", - "expression": "location | split(', ')[0] | parsefloat()" - } - ] - } - ], - "lazy": [], - "static_attributes": [], - "commands": [] - } - ] -} \ No newline at end of file diff --git a/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json b/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json index 694b1c4cc..83e3926c9 100644 --- a/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json +++ b/test/unit/examples/deviceProvisioningRequests/provisionFullDevice.json @@ -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": [], diff --git a/test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json b/test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json deleted file mode 100644 index a55b8a901..000000000 --- a/test/unit/examples/groupProvisioningRequests/bidirectionalGroup.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "services": [ - { - "resource": "/deviceTest", - "apikey": "801230BJKL23Y9090DSFL123HJK09H324HV8732", - "entity_type": "TheLightType", - "commands": [], - "lazy": [], - "attributes": [ - { - "name":"location", - "type":"geo:point", - "expression": "${latitude}, ${longitude}", - "reverse": [ - { - "object_id":"latitude", - "type": "Number", - "expression": "location | split(', ')[1] | parsefloat()" - }, - { - "object_id":"longitude", - "type": "Number", - "expression": "location | split(', ')[0] | parsefloat()" - } - ] - } - ], - "static_attributes": [] - } - ] -} diff --git a/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js b/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js index 3a12084bb..fbe307897 100644 --- a/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +++ b/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js @@ -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(); }); }); @@ -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(); }); }); diff --git a/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js b/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js index d51632100..b2e31db77 100644 --- a/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +++ b/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js @@ -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(); }); }); @@ -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(); }); });