On an older thread “akbooer” was kind enough to provide the code to produce a device list sorted by device number as follows:
local file = io.open("/www/devlist.txt", "w")
file:write("[DeviceNo / id] device names on " .. os.date() .. "\n")
local idx = {}
for deviceNo in pairs(luup.devices) do
idx[#idx+1] = deviceNo
end
table.sort (idx)
for _,deviceNo in ipairs(idx) do
d = luup.devices[deviceNo]
file:write(string.format('[%03d / %s] %s \n', deviceNo, d.id, d.description))
end
file:close()
Would anyone be able to modify the code to provide the Device ID of both the device as well as its “parent” if any?