piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.54k stars 330 forks source link

[Feature]: Add a chip line in mushroom template card #1286

Open BBE-FR opened 10 months ago

BBE-FR commented 10 months ago

Requirements

Is your feature request related to a problem?

In order to build more customized mushroom card, some usage require to have additional buttons.

One very interresting option to have these buttons would be to have a row of Mushroom Chips integrated into the mushroom template card. Chips already integrate many customisation option and are coherent in term of design with the other Mushroom cards.

A line of Chip is a very versatile solution:

Describe the solution you'd like

I would like to have an optional row of chip:

Describe alternatives you've considered

Stack-in of template card + chip is the option I use (like some others), but is not always obvious, it requires YAML input (not UI compatible) and often card_mod fine tuning and is not as versatile as if it was embedded into Mushroom Template card.

Additional context

Some ideas comming from here to show what it could look like (here for room cards): https://github.com/piitaya/lovelace-mushroom/issues/55

image

image

image

bdsoha commented 10 months ago

It would be great if there was an action section for templates cards. I have accomplished something similar using the following:

  type: grid
  columns: 2
  square: false
  cards:
    - type: custom:mushroom-entity-card
      entity: binary_sensor.****
      icon_color: red
      name: ****
      tap_action:
        action: none
      hold_action:
        action: none
      double_tap_action:
        action: none
    - type: custom:paper-buttons-row
      styles:
        justify-content: flex-end
      base_config:
        preset: mushroom
        styles:
          button:
            margin-top: 12px
            margin-right: 12px
      buttons:
        - icon: mdi:refresh
          entity_id: ****
          tap_action:
            action: toggle
BBE-FR commented 10 months ago

You can already have Tap action, Hold action and Double tap action for mushroom template card.

The point to have an embedded chips line is to have multiple additional button (or informations) into a template card.

bdsoha commented 10 months ago

@BBESINET As you mentioned, I was referring to multiple action buttons, similar to those found on vacuum and fan cards.

BBE-FR commented 5 months ago

For those interrested in such a row of chips / buttons:

I have presented my own version of a mushroom room card on the french Forum here: https://forum.hacf.fr/t/carte-mise-en-forme-de-ma-mushroom-room-card-et-tuto/20429

image image

do not hesitate to use the code...

And a french tuto step by step to install a simplified version here: https://forum.hacf.fr/t/carte-mise-en-forme-de-ma-mushroom-room-card-et-tuto/20429/12

Those version are 100% mushroom compatible, they even preserve the configuration through Graphical User Interface...