13.08.2021, 09:21
This can be optimized further by checking if the device as sent a telegram to a specific group address in the last X minutes. If it did then there's no point in checking the physical address. It's also advisable to add a small delay between each check so the bus is not overloaded.
For table iteration you can use ipairs, then the count loop is not needed (you can also use #addresses to get the table length).
See a similar example for the second function: https://forum.logicmachine.net/showthread.php?tid=1967
For table iteration you can use ipairs, then the count loop is not needed (you can also use #addresses to get the table length).
Code:
for _, address in ipairs(addresses) do
result = knxlib.ping(address)
if result == false then
content2 = content2 .. 'Address: ' .. address .. ' - <b>ERROR!</b><br>'
end
end
See a similar example for the second function: https://forum.logicmachine.net/showthread.php?tid=1967