Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles from Sections are resized after core update to 2024.8 #396

Open
sheaur opened this issue Aug 15, 2024 · 6 comments
Open

Tiles from Sections are resized after core update to 2024.8 #396

sheaur opened this issue Aug 15, 2024 · 6 comments

Comments

@sheaur
Copy link

sheaur commented Aug 15, 2024

Before:
Screenshot_20240814_160248_Home Assistant

After:
Screenshot_20240814_161028_Home Assistant

@sheaur
Copy link
Author

sheaur commented Aug 15, 2024

type: tile
name: Alarma Metereológica
entity: binary_sensor.meteo_alarma
show_entity_picture: true
vertical: false
hide_state: false
icon_tap_action:
  action: none
tap_action:
  action: more-info
card_mod:
  style:
    .: |
      ha-card {
        {% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "2; yellow; Moderate") %}
        --tile-color: yellow !important;
        {%- else -%}
        {% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "3; orange; Severe") %}
        --tile-color: orange !important;
        {%- else -%}
        {% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "4; red; High") %}
        --tile-color: red !important;
        {% endif %}
        {% endif %}
        {% endif %}
        ;
        }
    ha-tile-info$: |
      .secondary {
       visibility: hidden;
      }
      .secondary:before {
       visibility: visible;
       white-space: pre-wrap !important;
       content: '                                                                                                             '     
                "Empieza: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","onset")) | timestamp_custom ("%d-%m-%Y   %H:%M") }} " '                                                                '
                "Expira: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","expires")) | timestamp_custom ("    %d-%m-%Y   %H:%M") }} " '                                                           '
                '     ‎                                                                                                                                                                                    '
                " {{ state_attr("binary_sensor.meteo_alarma","headline") }}. " '                                                                                                                           '
                " {{ state_attr("binary_sensor.meteo_alarma","description") }} "   
      }
visibility:
  - condition: state
    entity: binary_sensor.meteo_alarma
    state: 'on'

@kafisc1
Copy link

kafisc1 commented Aug 18, 2024

Can confirm this issue.

@sheaur
Copy link
Author

sheaur commented Aug 18, 2024

The fault is in card-mod with the latest update from homeassistant

@Alessjo99
Copy link

Hi, do you know if an update to Card Mod is planned?

@mvanhelmont
Copy link

I also have the same issue, any workaround known?

@sheaur
Copy link
Author

sheaur commented Aug 31, 2024

I solved it without updating card mod

type: tile
name: Alarma Metereológica
entity: binary_sensor.meteo_alarma
show_entity_picture: true
vertical: false
hide_state: false
icon_tap_action:
  action: none
tap_action:
  action: more-info
visibility:
  - condition: state
    entity: binary_sensor.meteo_alarma
    state: 'on'
card_mod:
  style:
    .: |
      ha-card {
        {%if is_state('binary_sensor.meteo_alarma', 'off')%}
        --card-mod-icon-color: grey;
        {%- else -%}
        {% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '2; yellow; Moderate') %}
        --card-mod-icon-color: yellow;
        {%- else -%}
        {% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '3; orange; Severe') %}
        --card-mod-icon-color: orange;
        {%- else -%}
        {% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '4; red; High') %}
        --card-mod-icon-color: red;
        {% endif %}
        {% endif %}
        {% endif %}
        {% endif %}
        ;
        }
        ha-card {
        --tile-color: transparent !important;
        }
        ha-tile-info {
        height: 115px;
        }
    ha-tile-info$: |
      .primary {
       visibility: visible; 
      }
      .secondary {
       visibility: visible;
      }
      .secondary:after {
       visibility: visible;
       position: absolute;
       left: 0px;
       right: -180px;
       top: 38px;
       white-space: pre-wrap !important;
       content:                                                                                                                                                                        
                "Empieza: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","onset")) | timestamp_custom ("%d-%m-%Y    %H:%M") }}                                                             "                                                              
                "Expira: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","expires")) | timestamp_custom ("    %d-%m-%Y    %H:%M") }}                                                        "     
                '-                                                                                             '
                " {{ state_attr("binary_sensor.meteo_alarma","headline") }}. "                                                                                                                           
                " {{ state_attr("binary_sensor.meteo_alarma","description") }} "   
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants