piitaya / lovelace-mushroom

Mushroom Cards - Build a beautiful dashboard easily 🍄

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Lock Card Formatting Issue with Grid Card and Horizontal Layout

krazos opened this issue · comments

Current Behavior

Inside of a grid card with two columns, the lock card in horizontal layout cuts off unnecessarily large portions of the lock entity name and state, as shown in the screenshot below. For reference, I have included an entity card and a template card for the same lock entity, which show that there should be enough room for the lock card to display the full entity name and state, and still leave room for the lock/unlock button.

Expected Behavior

Lock card should use the full available space to display the lock entity name and state.

Steps To Reproduce

No response

Environment

- OS: Pop!_OS 22.04
- Browser: Chrome
- Version: 2.0.0
- Hassio: 2022.6.7

Anything else?

Screenshot from 2022-06-27 09-59-17

type: grid
columns: 2
square: false
cards:
  - type: custom:mushroom-lock-card
    entity: lock.front_door_lock
    fill_container: true
    name: Front Door
    layout: horizontal
  - type: custom:mushroom-entity-card
    entity: lock.front_door_lock
    name: Front Door
    fill_container: true
  - type: custom:mushroom-template-card
    primary: Front Door
    secondary: |-
      {% if is_state('lock.front_door_lock', 'locked') %}
        Locked
      {% elif is_state('lock.front_door_lock', 'unlocked') %}
        Unlocked
      {% else %}
        {{ states('lock.front_door_lock') }}
      {% endif %}
    icon: mdi:lock
    entity: lock.front_door_lock
    icon_color: |-
      {% if is_state('lock.front_door_lock', 'locked') %}
        green
      {% elif is_state('lock.front_door_lock', 'unlocked') %}
        red
      {% elif is_state('lock.front_door_lock', 'pending') %}
        orange
      {% endif %}

On further reflection, it appears that the lock card may be reserving space for an additional control button. If there is only one control button visible, perhaps that additional space could be allocated to the entity name/state portion of the card?