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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom buttons to template-card #1422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martindybal
Copy link
Contributor

@martindybal martindybal commented May 7, 2024

Description

Related Issue

This PR fixes or closes issue: fixes #
#887
#1421

Motivation and Context

As I mentioned in the last issue, I was a bit limited by the template card in some scenarios. It would be really great if I could have a quick action directly on my dashboard.

How Has This Been Tested

I tested it locally on my HA instance. I also created a sample in the dev box at /lovelace-mushroom-showcase/5.

image

Types of changes

  • 馃殌 New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have tested the change locally.
  • I followed the steps if I add a new language .

@martindybal martindybal force-pushed the feature/template-card-custom-buttons branch from 9c1c433 to be52ce6 Compare May 13, 2024 11:32
@BBE-FR
Copy link

BBE-FR commented May 31, 2024

For information, up to what level are the button customisable ?
For example can we like with a template chip:

  • define dynamic icon/color ?
  • define tap, hold and double tap actions ?
    If yes that is exactly what I wanted to create a room card !

Whatever the customization, Many Thanks @martindybal and I hope it goes up to release !

@martindybal
Copy link
Contributor Author

@BBE-FR Thank you very much for your feedback and support!

Regarding your questions:

Dynamic icon/color: This is not supported in the current PR, but can be easily added if needed.
Tap, hold and double tap actions: Only tap actions are currently supported, but again, they can be implemented if desired.

Before I proceed with these additions, I need to hear from @piitaya if he wants to finish this PR.

Thanks for your suggestions.

@piitaya
Copy link
Owner

piitaya commented Jun 2, 2024

Hi 馃檪
I like the idea but if we implement this, I think it must be an array instead of 4 elements.

Also I have concerns to bring new features like this to Mushroom because the gap between Mushroom and tile card become less important with HA updates. Many features request (icon tap action, card features, inverted cover slider, etc...) to Mushroom are improvements done to the tile card so it become hard to do the work in double.

I have some options but I didn't decided about the best solution :

  1. Implement all Mushroom features to tile card and deprecate Mushroom usage
  2. Implement all Mushroom features to tile card except template features. Mushroom will become a kind of "advanced tile card" with template support and advanced features.
  3. Freeze Mushroom dev and maintain it to avoid regression with HA updates.

The problem with adding this option is that it will encourage people to not use tile card and it can lead to more breaking changes in the future if we want to fully merge Mushroom with Home Assistant.

@BBE-FR
Copy link

BBE-FR commented Jun 2, 2024

@piitaya I imagine that the question is hard...

Option 1 would be Nice...

The lack of template card and chips are the only real things that make me stay with mushroom... without template its difficult to go back to tiles...

For the rest tiles are sligtly less customisable but its enought for 99% of time...

@jhemak
Copy link

jhemak commented Jun 2, 2024

+1 for Option 1 ... I would love to switch over to Tile Card 100% but am a heavy user of template and chip.

@martindybal
Copy link
Contributor Author

martindybal commented Jun 3, 2024

@piitaya I fully understand. The reason for 4 elements is layout, but it's not a problem to use an array with limited size. I'm just not sure about the UI editor.

I have no problem helping with the development of the Tile Card. I've switched to it myself in a few scenarios with mushrooms. My main reason for sticking with Mushrooms is

  1. Horizontal layout
    • I added card_mod
  2. Better tap and hold action management
    • hold_action doesn't work above the icon. It uses icon_tap_action even with hold.
  3. Features like animated icons

I'm using combination of Mushrooms and tile card for all my room like this
image

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

Successfully merging this pull request may close these issues.

None yet

4 participants