Error: EventSystem: in updateCounters: [string "commandArray = {}..."]:3: bad argument #3 to 'format' (number has no integer representation)
which I do not understand. Any pointers to what I'm doing wrong?
Code: Select all
commandArray = {}
local function updatenum(dev, value1)
local cmd = string.format("%d|0|%d", otherdevices_idx[dev], value1)
table.insert (commandArray, { ['UpdateDevice'] = cmd } )
end
if (devicechanged['Quooker'] == 'On') then
updatenum('Quooker Top-Ups', tonumber(otherdevices['Quooker Top-Ups']) + 1)
end
return commandArray