custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
386 stars 30 forks source link

decluttering inside a core grid card behaves oddly, changes size of the grid tile #59

Open Mariusthvdb opened 1 year ago

Mariusthvdb commented 1 year ago

Checklist:

Release with the issue: 0.6.3 HACS

Home Assistant 2023.2.0b7 Supervisor 2023.01.1 Operating System 9.4 Frontend-versie: 20230130.0 - latest

Last working release (if known):

Browser and Operating System: Any really tested Chrome, Safari, Firefox on Mac

Description of problem:

seems decluttering changes the way a grid card sees the final card, in this case a custom minimalistic area card.

first card is decluttered and only shows the top section of the grid 1st card 2nd card is a verbose card and shows full size

  - type: grid
    columns: 4
    cards:

        - type: custom:decluttering-card
          template: minimalistic_area
          variables:
            - title: ' '
            - main_id: light.laundry_ceiling
            - temp_id: sensor.laundry_sensor_temperature
            - humid_id: sensor.laundry_sensor_illuminance
            - motion_id: binary_sensor.laundry_sensor_motion
            - image: bijkeuken_klein.jpg
            - path: bijkeuken

        - type: custom:minimalistic-area-card
          card_mod:
            style: |
              ha-card {
                filter: {{'grayscale(0%)' if
                          (is_state('light.laundry_ceiling','on') or
                           is_state('binary_sensor.laundry_sensor_motion','on'))
                          else 'grayscale(100%)'}};
                border-top: {{'1rem solid red' if is_state('binary_sensor.laundry_sensor_motion','on')
                      else 'none'}};
              }
#           title: Laundry
          image: /local/images/areas/bijkeuken_klein.jpg
          shadow: false
          tap_action:
            action: navigate
            navigation_path: /ui-sub-views/bijkeuken
          hold_action:
            action: call-service
            service: light.toggle
            service_data:
              entity_id: light.laundry_ceiling
          entities:
            - entity: sensor.laundry_sensor_temperature

Javascript errors shown in the web inspector (if applicable): No errors

Additional information:

decluttering template is a verbosely copied original card, albeit with variables:

card:
  type: custom:minimalistic-area-card
  card_mod:
    style: |
      ha-card {
        filter: {{'grayscale(0%)' if
                  (is_state('[[main_id]]','on') or
                   is_state('[[motion_id]]','on'))
                  else 'grayscale(100%)'}};
        border-top: {{'1rem solid red' if is_state('[[motion_id]]','on')
              else 'none'}};
      }
  title: '[[title]]'
  hide_unavailable: true
  area: '[[area]]'
  image: /local/images/areas/[[image]]
  shadow: false
  tap_action:
    action: navigate
    navigation_path: /ui-sub-views/[[path]]
  hold_action:
    action: call-service
    service: light.toggle
    service_data:
      entity_id: '[[main_id]]'
  entities:
    - entity: '[[temp_id]]'
    - entity: '[[humid_id]]'
Scherm­afbeelding 2023-01-31 om 16 10 23

all other functionality is alive and working perfectly, including the card_mod templates and actions