Today I tried to finetune my card but I was getting this error:
TypeError
Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a Symbol.iterator method.
This problem was years ago there aswell and i was hopinh if i can on some way help debug it.
type: custom:button-card
entity: button.coffee_power_toggle
name: Coffee Power
state:
- value: "on"
color: green
- value: "off"
color: gray
styles:
grid:
- grid-template-areas: "\"battery\" \"name\""
- justify-items: center
custom_fields:
battery:
position: absolute
top: 5%
right: 5%
font-size: 12px
color: white
custom_fields:
battery: |
[[[
return `<ha-icon icon="mdi:battery" style="font-size: 14px;"></ha-icon>
${states['sensor.coffee_power_toggle_battery'].state}%`;
]]]
tap_action:
action: toggle