is there a way to obtain (or generate new one) the otherdevices table sorted somehow?
by name would be the best, but even by IDX would be nice...
actually if I browse the table on the same script, I get different order everytime.... (_lastupdate? )
for my use... it is actually impossible to handle an unsorted table

ciao
M
P.S.
as explainantion this is a simple browsing of the table:
Code: Select all
commandArray = {}
print ('-----------------------------------')
for devName, devStatus in pairs(otherdevices) do
if (string.sub(devName,1,4)) == 'MAG_' then
print ('>> TEST >>> '..devName)
end
end
print ('-----------------------------------')
return commandArray
the2017-03-10 15:08:40.213 LUA: -----------------------------------
2017-03-10 15:08:40.213 LUA: >> TEST >>> MAG_Bagnetto_Finestra
2017-03-10 15:08:40.213 LUA: >> TEST >>> MAG_Cucina
2017-03-10 15:08:40.213 LUA: >> TEST >>> MAG_Cameretta
2017-03-10 15:08:40.214 LUA: >> TEST >>> MAG_Bagnetto
2017-03-10 15:08:40.214 LUA: >> TEST >>> MAG_Camera
2017-03-10 15:08:40.214 LUA: >> TEST >>> MAG_Ingresso
2017-03-10 15:08:40.214 LUA: -----------------------------------
2017-03-10 15:08:40.346 LUA: -----------------------------------
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Ingresso
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Bagnetto
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Camera
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Bagnetto_Finestra
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Cameretta
2017-03-10 15:08:40.346 LUA: >> TEST >>> MAG_Cucina
2017-03-10 15:08:40.346 LUA: -----------------------------------
table.sort(otherdevices)
seems not to be a solution....