custom-cards / button-card

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

card looks different in new dev version #731

Closed Protoncek closed 1 year ago

Protoncek commented 1 year ago

Checklist

Describe the bug When i update to latest dev version icons in my card are partly hidden, while in version 3.5.0 are totally visible.

Version of the card Version: 4.0.0.dev11

To Reproduce This is the configuration I used:

type: custom:button-card
name: CAME
size: 100%
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      style: |
        --popup-border-color: lime;
        --popup-border-width: 5px;
        text-align: center;
      content: |
        [[[
        if (states['binary_sensor.zunaj_vrata_odprta'].state =='off')
          return "ODPREM vrata CAME?"
        else
          return "ZAPREM vrata CAME?"
        ]]]
      right_button: JA itaq, ane!
      left_button: JOJ, NE! Prst mi je zdrsnu
      right_button_action:
        service: switch.toggle
        data:
          entity_id: switch.zunaj_odpiranje
      left_button_action:
        service: browser_mod.popup
        data:
          style: |
            --popup-border-color: lime;
            --popup-border-width: 5px;
            text-align: center;
          content: ...pol pa nič, ane?
          dismissable: true
          title: Ja, prav...
          timeout: 3000
hold_action:
  action: call-service
  service: |
    [[[
    if(states['switch.zunaj_stop'].state=='on')
    return "script.came_start"
    else
    return "script.came_stop"
    ]]]
double_tap_action:
  action: more-info
  entity: binary_sensor.zunaj_vrata_odpiranje
entity: switch.zunaj_odpiranje
show_icon: true
icon: |
  [[[
    if (states['binary_sensor.zunaj_vrata_odprta'].state =='off')
      return "mdi:gate"
    else
      return "mdi:gate-open"
  ]]]
show_label: true
label: |
  [[[
    if (states['switch.zunaj_stop'].state=='on')
      return "BLOKRIANA"
    if (states['binary_sensor.zunaj_vrata_odprta'].state =='off')
      return "ZAPRTA"
    if (states['binary_sensor.zunaj_vrata_zapiranje'].state =='on')
      return "ZAPIRANJE"
    if (states['binary_sensor.zunaj_vrata_odpiranje'].state =='on')
      return "ODPIRANJE"
   return "ODPRTA"
  ]]]
styles:
  card:
    - height: 65px
    - box-shadow: 0 0 0.30rem 0.2rem rgb(100,100,100)
  label:
    - font-size: 15px
    - font-weight: bold
  name:
    - font-size: 15px
    - font-weight: bold
style: |
  ha-card {
  {% if is_state('binary_sensor.zunaj_vrata_odpiranje', 'on') %}  
        background: cyan;
        --paper-item-icon-color: blue;
        {%elif is_state('binary_sensor.zunaj_vrata_zapiranje', 'on') %}  
        background: red;
        --paper-item-icon-color: lime;
        {%elif is_state('binary_sensor.zunaj_vrata_odprta', 'on') %}
        background: lime;
        --paper-item-icon-color: black;        
        {%else%} 
        background: black;
        --paper-item-icon-color: lime;        
        {% endif %};

  }

Screenshots correct behaviour wrong behaviour

Desktop (please complete the following information):

Additional context Is it something i did wrong in coding? I wrote these cards quite ago and they may be "odd"...so any suggestions what (if any) i did wrong will be welcome

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.0.0-dev.12 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: