fibaro:setGlobal(varName, value)
-- Assign the value 1 to the global variable named 'index'
fibaro:setGlobal
(
'index'
, 1)
-- Increase the value of the global variable 'test' by 3
fibaro:setGlobal
(
'test'
,
fibaro:getGlobalValue
(
'test'
) + 3)
-- Assign the value of the local variable 'a'
-- to the global variable 'index'
local
a = 10 * 234
fibaro:setGlobal
(
'index'
, a)
fibaro:setGlobal
can be used only for global variables that are not read-only variables. If you try to overwrite a read-only variable, a read-only warning is generated and the operation is not performed.