custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

ha-state-icon change requiring config change? #728

Closed Mariusthvdb closed 1 year ago

Mariusthvdb commented 1 year ago

Checklist

Describe the bug A clear and concise description of what the bug is.

Sorry if this is more of a question than an issue, but not biggie enough for a first discussion:...

since b2 follows ha-state-icon, do we need to change that in our configs too?: in other words, do we need to change:

  custom_fields:
    icon: >
      [[[ return `<ha-icon icon='mdi:lock-alert'></ha-icon>`; ]]]

to

  custom_fields:
    icon: >
      [[[ return `<ha-state-icon icon='mdi:lock-alert'></ha-state-icon>`; ]]]

ofc, I did first try this before posting, and both seem to work, without any errors in the log. So just asking for confirmation, and generic guideline.

Version of the card Version:

To Reproduce This is the configuration I used:

  custom_fields:
    icon: >
      [[[ return `<ha-icon icon='mdi:lock-alert'></ha-icon>`; ]]]
  styles:
    custom_fields:
      icon:
        - position: absolute
        - left: 70%
        - top: 5%
        - z-index: 5
        - height: 22px
        - width: 22px
        - color: red

Screenshots If applicable, add screenshots to help explain your problem.

Scherm­afbeelding 2023-07-25 om 11 22 33

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

before you ask why I dont use the lock config option: these are buttons where the lock is permanent, so no option to unlock is allowed. -alert indicating that, and setting those buttons apart from the other un unlockable buttons in my config

Scherm­afbeelding 2023-07-25 om 11 24 26
RomRider commented 1 year ago

Both work, you can use ha-icon or ha-state-icon (even though ha-state-icon is "supposed" to be used when it's related to an entity which is not your case)

Mariusthvdb commented 1 year ago

thx, closing