Hello,
i want to change a Text in a widget based on a item state, but i want to change the text via property.
here i define what text should be shown when item is ON or OFF
- label: On Text
name: ontext
required: false
type: TEXT
- label: Off Text
name: offtext
required: false
type: TEXT
but how is the syntax for that in Label? the text here change on item state from/to text1 and text2. This works but how i “add” here the 2 props from above ontext and offtext
- component: Label
config:
text: '=(items[props.item].state === "ON") ? "text1" : "text2"'
style:
font-size: 12px
margin-top: 0px