Hi,
I'm using the Maker API /devices and /devices/all endpoints and struggling to handle 2 different issues with them
- /devices/all is SLOW.. takes 4-5 seconds to return for my ~25 devices but takes minutes to return on users with lots (ie: 100) devices..
- I can use /devices to get all of the device ID's quickly but then I need to use /deices/ID to get info for each device. But the JSON response to this endpoint isn't JSON and it's causing my JSON parser to crash. The "capabilities" field mixes String's and Objects in an array which isn't valid AFAIK.
I'm curious how anyone is able to parse this output actually.. at least everything I've tried using the GSON parser fails miserably..
http://192.168.0.202/apps/api/38/devices/[Device ID]
"capabilities" :
[
"Switch",
{
"attributes" :
[
{
"name" : "switch",
"dataType" : null
}
]
},
"Polling",
"Refresh",
"Valve",
{
"attributes" :
[
{
"name" : "valve",
"dataType" : null
}
]
},
"Sensor",
"Actuator"
],
For the /devices/all endpoint, why is it so slow? Shouldn't the hub just return all of the current state info it has cached in memory? Would it be possible to put in a parameter to return 'pages' of devices at a time (vs everything)?