I have this in Lua:
Code: Select all
if aircoValueVaneZKval == "10" then
commandArray['UpdateDevice'] = "739|0|50"
else
local aircoValueVaneZKval2 = aircoValueVaneZKval * 10
commandArray['UpdateDevice'] = "739|0|" .. tostring(aircoValueVaneZKval2) .. "|"
end
The values can be:
aircoValueVaneZKval: 1 -> this has to be converted into 10, hence the * 10
aircoValueVaneZKval: 2 -> this has to be converted into 20, hence the * 10
aircoValueVaneZKval: 3 -> this has to be converted into 30, hence the * 10
aircoValueVaneZKval: 4 -> this has to be converted into 40, hence the * 10
aircoValueVaneZKval: 10 -> this has to be converted into 50......
So, where is the fault in my script?