I am new to dzvents, sorry if this is trivial, but I cannot find a way of calling a helper function B from another function A both defined in global_data.lua. Just to be concrete, here is the code I am trying to run.
Code: Select all
return{
helpers={
mysplit=function(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end,
timeEqual=function(myTime)
local Time = require('Time')
local now= Time() -- current time
local hour=now.hour
local minute=now.min
local Time0=mysplit(myTime,':')
if(hour == tonumber(Time0[1]) and minute == tonumber(Time0[2]))then
return true
else
return false
end
end
},
data = {
temperatures = { history = true, maxItems = 10 },
temp = { initial={},history = true, maxItems = 10 },
T_0= {initial=24.0 }
},
}
Thanks beforehand!