I would like to know the way that the devices are listed out in the array. Is the devices that is obtained from the Resources.devices.list()listed by the time it is created or by the relevant tags?
and is there away to filter their data after obtaining it through this way? :
for(const device of array\_devices){
const vari = await Resources.devices.getDeviceData(device.id,{
variables: <variable>,
qty: quantity,
start\_date: "2024-06-09T16:00",
end\_date: end
});
device\_result.push(vari);
}
The devices obtained from the Resources.devices.list() method will be listed in an the alphabetical order. You could use the javascript filter() method after using the API or you could also filter it in the query itself using the DataQuery.
Yeah, you can get multiple variables using the await Resources.devices.getDeviceData() method by adding them like such: