EMULATOR "fr945"
MIN API LEVEL "3.0.0"
API DATA STRUCTURE
{
"data": {
"devices": [
{
"device": "00:0E:00:AD:00:00:00:4A",
"model": "H6008",
"deviceName": "Mudroom",
"controllable": true,
"retrievable": true,
"supportCmds": [
"turn",
"brightness",
"color",
"colorTem"
],
"properties": {
"colorTem": {
"range": {
"min": 2700,
"max": 6500
}
}
}
}
]
},
"message": "Success",
"code": 200
}
CODE
if (args instanceof Dictionary) {
var keys = args.keys();
_message = "";
for (var i = 0; i < keys.size(); i++) {
_message += Lang.format("$1$: $2$\n", [keys[i], args[keys[i]]]);
}
}
When I run through the object, message
and code
print(and their values), but data
does not. Even so, getting it to print wouldn't solve my issue, I am trying to drill into the data.devices[] array to be able to access the information in each array index. Ex: data.devices[0].dataName and print that information.
Is this even possible with Monkey C?
Roughly figured it out-