Pass variable into include
You can leave the with lightswitchTest part off altogether, and all the variables from the parent template will be available inside the include too.

with expects an array, where the keys correspond to the variable names and their values, so if you did want to explicitly pass that in (say as a different variable) you could use:

page.twig

{% include "_snippets/thingy" with { active: lightswitchTest } %}


thingy.twig

&lt;div class="panel{% if not active %} notActive{% endif %}"&gt;
    {# bla bla #}
&lt;/div&gt;