[Reactor] Assignment to alarm ignored -- expression-driven global cannot be set by assignment
-
Hi @toggledbits,
I have lots of logs with this:
<Engine:ERR> Assignment to alarm ignored -- expression-driven global cannot be set by assignment
Any hints to where look at to avoid this? Thanks.
-
Only expression-less global variables can be set by an assignment. You have a script/expression somewhere that's attempting to change the value. The lines leading up to that message may provide a clue what actions are occurring.
-
I found it, but I had to search inside the json's rules with VS code. I had a local variable with the same name of global one. Not easy to be found, since it was a local variable in a local expression and nothing was logged before to give me context. Thanks!
-
The error message will be improved, but for reference for future readers, there are two ways to fix this when it happens:
-
Change the name of your local variable.
-
Explicitly declare and initialize your local variable at the start of your expression as explicitly
local
. For example, assumingalpha
is the name of a global expression/variable but we want to use it as a local variable name:local alpha=0, each e in matchEntities( { capability: 'dimming' } ): alpha = alpha + 1
-
-
T toggledbits unlocked this topic on
-
T toggledbits locked this topic on