telefonicaid / iotagent-ul

IoT Agent for a UltraLight 2.0 based protocol (with HTTP, MQTT and AMQP transports)
https://fiware-iotagent-ul.rtfd.io/
GNU Affero General Public License v3.0
37 stars 55 forks source link

Use mergeDeviceWithConfiguration from IOTA Lib instead of defining own function #642

Closed fgalan closed 8 months ago

fgalan commented 9 months ago

While reviewing PR https://github.com/telefonicaid/iotagent-ul/pull/640 we have realized that while IOTA-JSON uses directly the mergeDeviceWithConfiguration function from library:

https://github.com/telefonicaid/iotagent-json/blob/master/lib/iotaUtils.js#L246

In the case of IOTA-UL the same fucntion is redefined within lib/iotaUtils.js (in fact that's why PR #640 is necessary).

This is weird... IOTA-UL should aling with IOTA-JSON and use also the function directly from library (thus simplifying and gainging the advantages of code reuse).

Maybe there is a good reason (that we don't remember now :) to do the current way, in which case an explination should be provided as comment in this issue before closing it.

fgalan commented 8 months ago

PR https://github.com/telefonicaid/iotagent-ul/pull/644