I'm offering a way to update a connector variable in my dashboard app but running into a minor issue.. how to know what data type the variable is. For example, if I knew it was a number type, I could just show the number keypad and not allow strings to be set.
So, first question is - is there already a way to distinguish between different Connector variable types (ie: boolean, number, decimal, string)?
I don't see one looking at the device detail response (example below)
If not, can a way be added? I would have thought "dataType" : "STRING"
would have been the ideal way to convey this (ie: replace STRING with NUMBER) but I can see how that might brake other apps.. but, just wanted to get the question out there to see if others were wondering it too..
133) GET http://192.168.0.210/apps/api/38/devices/694
<< 133) 305b, DATA:
{
"id" : "694",
"name" : "DecimalVariable",
"label" : "DecimalVariable",
"type" : "Connector Variable",
"attributes" :
[
{
"name" : "variable",
"currentValue" : "45.12",
"dataType" : "STRING"
}
],
"capabilities" :
[
"Actuator",
"Variable",
{
"attributes" :
[
{
"name" : "variable",
"dataType" : null
}
]
},
"Sensor"
],
"commands" :
[
"parse",
"setVariable"
]
}