telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 85 forks source link

static atributes are always inserted as string, non native types #1035

Closed AlvaroVega closed 3 years ago

AlvaroVega commented 3 years ago

Should be inserted using native types

AlvaroVega commented 3 years ago

This only happens when body values are sting instead of native types like:

time=2021-05-11T15:09:44.692Z | lvl=DEBUG | corr=fcc668bb-cef3-418c-be4b-826e5d34b991 | trans=fcc668bb-cef3-418c-be4b-826e5d34b991 | op=IoTAgentNGSI.GenericMiddlewares | from=172.17.0.24 | srv=smartcity | subsrv=/ | msg=Body:

{
    "devices": [
        {
            "device_id": "disp11",
            "timestamp": true,
            "attributes": [
                {
                    "object_id": "minumero",
                    "name": "minumero",
                    "type": "Number"
                },
                {
                    "object_id": "miboolean",
                    "name": "miboolean",
                    "type": "Boolean"
                },
                {
                    "object_id": "minulo",
                    "name": "minulo",
                    "type": "None"
                },
                {
                    "object_id": "mistring",
                    "name": "mistring",
                    "type": "String"
                }
            ],
            "static_attributes": [
                {
                    "name": "minumero_st",
                    "type": "Number",
                    "value": "33"
                },
                {
                    "name": "miboolean_st",
                    "type": "Boolean",
                    "value": "true"
                },
                {
                    "name": "minulo_st",
                    "type": "None",
                    "value": "null"
                },
                {
                    "name": "mistring_st",
                    "type": "String",
                    "value": "hola"
                }
            ],
            "protocol": "IoTA-UL",
            "apikey": "9wxl46kt1w4ijy9gul5zyif1m"
        }
    ]
}
AlvaroVega commented 3 years ago

This is not a bug