thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.08k stars 168 forks source link

Little help to integrate with paper-button-row #216

Closed miberecz closed 1 year ago

miberecz commented 2 years ago

Hello Folks,

Not an issue, but a cry for help, hope its not a problem. I'm trying to manipulate a paper-button-row custom card. I have an AirConditioner which I control with paper-buttons: turn on for time period, or off. Also I have an automation to control it based on a preset. I figured, if the automation is ON, i do not want anyone to mess around with the manual settings, so I disabled them with card-mode. image Problem, is I cannot disable only the paper-buttons, but the whole entity-row, with the icon (visual issue) and the title, which means I cannot access the state history and such. image

Could someone help me please to apply my mods only on the paper-buttons?

My code would be this so far:

type: entities
entities:
  - entity: automation.toohotinhere
    card_mod:
      style: |
        :host {
          {% if is_state('automation.toohotinhere','on') %}
            --paper-item-icon-color: var(--disabled-text-color);
            pointer-events: none;
          {% endif %}
          }
    extend_paper_buttons_row:
      position: right
      base_config:
        style:
          button:
            background-color: lightblue
            border-radius: 4px
            padding-top: 2px
            padding-right: 6px
            padding-bottom: 2px
            padding-left: 5px
            margin-right: 5px
            border-style: solid
            border-width: 2px
            font-weight: 500
      buttons:
        - entity: asd.asd
          layout: icon|name
          name: auto
          style:
            button:
              width: 100%
              background-color: none
              border-style: none
              border-width: 2px
              font-weight: 500
              justify-content: flex-start
            ripple:
              display: none
        - name: 30M
          tap_action:
            action: call-service
            service: script.KlimaFor30Script
        - name: 1H
          tap_action:
            action: call-service
            service: script.KlimaFor1hScript
        - name: 2H
          tap_action:
            action: call-service
            service: script.1656525217310
        - name: 'OFF'
          tap_action:
            action: call-service
            service: script.offklima
ildar170975 commented 2 years ago

Not an issue, but a cry for help, hope its not a problem.

Please ask these questions in a dedicated card-mod community thread