I’m having real troubles understanding the whole YAML language.
Now, i have a label card in the overview page that opens a popup to a keypad to enable/disable the alarm.
- component: oh-label-card
config:
action: popup
actionModal: page:page_ef81f3e858
icon: f7:lock_shield
iconSize: 100
padding: 10px
iconColor: "= (items.Alarm_State.state === 'OFF') ? 'green' :
(items.Alarm_State.state === 'ARMING') ? 'blue' :
(items.Alarm_State.state === 'HOME') ? 'orange' :
(items.Alarm_State.state === 'AWAY') ? 'red' :
(items.Alarm_State.state === 'TRIGGERED') ? 'purple' :
'grey'"
This is the result. It works, changes color according to status, but i’m really struggling to center the icon (and remove the -, that right now i’m doing assigning ’ label:" " ’ )
Can anyone point me in the right direction?