marcokreeft87 / room-card

Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI
MIT License
226 stars 38 forks source link

Crashing if using card_mod #107

Closed tanker11 closed 2 years ago

tanker11 commented 2 years ago

Which version of Room Card? 1.07.00

Describe the bug If a Room Card is used with a certain code of card_mod containing templates, Lovelace GUI reports "connection lost" periodically. Dame card_mod code does not cause same on other card types.

To Reproduce Steps to reproduce the behavior:

  1. Create a Room Card: type: custom:room-card title: Storage entity: light.0f_storage_main tap_action: action: toggle icon: mdi:lightbulb-outline show_icon: true

  2. Add the following code at the end: card_mod: style: | ha-card {

    border: {% if is_state('light.0f_storage_main', 'on') %} solid 1px var(--paper-item-icon-active-color) {% else %} solid 1px var(--primary-background-color) {% endif %} ; box-shadow: {% if is_state('light.0_furdo', 'on') %} 0px 0px 10px 3px var(--paper-item-icon-active-color) {% else %} none {% endif %} ;

    }

Expected behavior It tries to make a 'glow' effect if the entity is on. And it works on other cards (like a simple entity card).

Desktop (please complete the following information):

HA: Home Assistant 2022.10.1 (Docker) Room Card installed via HACS

tanker11 commented 2 years ago

Could be eliminated if it is changed to Feature Request for styling the Card itself...

marcokreeft87 commented 2 years ago

Have you read the wiki? https://github.com/marcokreeft87/room-card/wiki/Configuration Room Card has styles where you can customize the styling of the card, even with templating (https://github.com/marcokreeft87/room-card/wiki/Configuration#templating)

tanker11 commented 2 years ago

I have read, yes, but not found out how to do it. I will give it another try and confirm.

Marco Kreeft @.***> ezt írta (időpont: 2022. okt. 25., K, 11:36):

Have you read the wiki? https://github.com/marcokreeft87/room-card/wiki/Configuration Room Card has styles where you can customize the styling of the card, even with templating.. But FYI this is not a bug in room card.

— Reply to this email directly, view it on GitHub https://github.com/marcokreeft87/room-card/issues/107#issuecomment-1290268190, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVM6O4KAMXKMBMPZNSZNP3WE6SZBANCNFSM6AAAAAARNYVHUU . You are receiving this because you authored the thread.Message ID: @.***>

tanker11 commented 2 years ago

Tried with the following result: [image: image.png]

As you can see the main entity is also in a box, so I cannot make difference between the card and its container. Is there workaround for this?

Marco Kreeft @.***> ezt írta (időpont: 2022. okt. 25., K, 11:36):

Have you read the wiki? https://github.com/marcokreeft87/room-card/wiki/Configuration Room Card has styles where you can customize the styling of the card, even with templating.. But FYI this is not a bug in room card.

— Reply to this email directly, view it on GitHub https://github.com/marcokreeft87/room-card/issues/107#issuecomment-1290268190, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVM6O4KAMXKMBMPZNSZNP3WE6SZBANCNFSM6AAAAAARNYVHUU . You are receiving this because you authored the thread.Message ID: @.***>

marcokreeft87 commented 2 years ago

The image isn't working

tanker11 commented 2 years ago

image

marcokreeft87 commented 2 years ago

Can you share the full yaml of the card?

tanker11 commented 2 years ago

Sure (sorry, some Hungarian names in it):

type: custom:room-card title: Fürdő entity: light.0_furdo style: | @keyframes spin { from {transform:rotate(0deg);} to {transform:rotate(360deg);} } styles: template: > if (entity.state == 'on') return 'border:solid 1px var(--paper-item-icon-active-color);box-shadow:0px 0px 10px 3px var(--paper-item-icon-active-color)'; else return 'border:solid 1px var(--primary-background-color);box-shadow:none'; tap_action: action: toggle icon: mdi:lightbulb-outline show_icon: true rows:

Marco Kreeft @.***> ezt írta (időpont: 2022. okt. 25., K, 12:43):

Can you share the full yaml of the card?

— Reply to this email directly, view it on GitHub https://github.com/marcokreeft87/room-card/issues/107#issuecomment-1290344873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVM6O2OQGVQ6DL5NK6WXPTWE62TTANCNFSM6AAAAAARNYVHUU . You are receiving this because you authored the thread.Message ID: @.***>

marcokreeft87 commented 2 years ago
var(--paper-item-icon-active-color);box-shadow:0px 0px 10px 3px
    var(--paper-item-icon-active-color)'; else return 'border:solid 1px

These will set the border around the main entity icon. I guess thats not what you want?

tanker11 commented 2 years ago

Indeed. My intention is to set the border only around the whole card.

Marco Kreeft @.***> ezt írta (időpont: 2022. okt. 25., Ke 13:41):

var(--paper-item-icon-active-color);box-shadow:0px 0px 10px 3px var(--paper-item-icon-active-color)'; else return 'border:solid 1px

These will set the border around the main entity icon. I guess thats not what you want?

— Reply to this email directly, view it on GitHub https://github.com/marcokreeft87/room-card/issues/107#issuecomment-1290414788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVM6O3RUUFVNP4BK4LJVODWE7BPTANCNFSM6AAAAAARNYVHUU . You are receiving this because you authored the thread.Message ID: @.***>

marcokreeft87 commented 2 years ago

Indeed. My intention is to set the border only around the whole card. Marco Kreeft @.> ezt írta (időpont: 2022. okt. 25., Ke 13:41): var(--paper-item-icon-active-color);box-shadow:0px 0px 10px 3px var(--paper-item-icon-active-color)'; else return 'border:solid 1px These will set the border around the main entity icon. I guess thats not what you want? — Reply to this email directly, view it on GitHub <#107 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVM6O3RUUFVNP4BK4LJVODWE7BPTANCNFSM6AAAAAARNYVHUU . You are receiving this because you authored the thread.Message ID: @.>

Remove the 2 lines I quoted and that will do what you want

tanker11 commented 1 year ago

Thanks, but the two lines make the highlighted shadow around the whole card, too, so if I remove them, it will not work. So it is intentionally there, but not only the whole card, but the main entity icon behaves like the card. In other words I cannot make difference between the card box and entity box... :/