YAML Logical OR

Hello,

I’ve tried looking for the solution, and tried whatever I could think of, but with no success.
What I’ve been trying to do, is change visibility of my entire widget, depending on state of 3 alarms, if any of the alarms is ON, visibility is true.

My sad attempt to get the idea better :

visibility: "=((items[props.alarm1].state OR items[props.alarm2].state === 'ON')) ? 'hidden' : 'visible'"

visibility: "=((items[props.alarm1].state || items[props.alarm2].state === 'ON')) ? 'hidden' : 'visible'"

In most computer languages, you cannot use syntax like
if A or B = X
you have to spell it out in clearer terms
if A = X or B = X

Thank you, got it working! :slight_smile:
Ill post it, if someone else cant find a solution to something similar

visibility: "=((items[props.alarm1].state === 'ON') || (items[props.alarm2].state === 'ON')) ? 'hidden' : 'visible'"
1 Like