Skip to content

Commit 0bae5c0

Browse files
authored
Merge pull request #444 from telefonicaid/bug/missingAttributesInUpdate
FIX missing attributes in update
2 parents ffe39da + 5fdf9dd commit 0bae5c0

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGES_NEXT_RELEASE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
- FIX IOTAM Registrations won't send static attributes in group information #430
44
- FIX Update device operation ignores static attributes (#137)
55
- Static attributes not shown in device group updates (#423)
6+
- FIX Missing attributes in update.

lib/services/devices/deviceRegistryMongoDB.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ function update(device, callback) {
248248
data.lazy = device.lazy;
249249
data.active = device.active;
250250
data.internalId = device.internalId;
251+
data.staticAttributes = device.staticAttributes;
252+
data.commands = device.commands;
253+
data.endpoint = device.endpoint;
254+
data.name = device.name;
255+
data.type = device.type;
251256

252257
data.save(saveDeviceHandler(callback));
253258
}

lib/services/devices/deviceService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ function updateRegisterDevice(deviceObj, callback) {
467467
oldDevice.name = newDevice.name;
468468
oldDevice.type = newDevice.type;
469469
oldDevice.timezone = newDevice.timezone;
470+
oldDevice.endpoint = newDevice.endpoint || oldDevice.endpoint;
470471

471472
callback(null, oldDevice);
472473
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "iotagent-node-lib",
33
"description": "IoT Agent library to interface with NGSI Context Broker",
4-
"version": "2.1.3",
4+
"version": "2.1.4",
55
"homepage": "https://github.com/telefonicaid/iotagent-node-lib",
66
"keywords": [
77
"fiware",

0 commit comments

Comments
 (0)