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

Add new heading_type "image" to Heading Card #23594

Closed
wants to merge 2 commits into from

Conversation

renzet
Copy link

@renzet renzet commented Jan 5, 2025

Proposed change

This PR extends the new Heading card to allow it to show an image instead of text. This can be used to show logo's for example:

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

The input type image (the same as is used in the Picture card) supports image upload, a local path or a web URL:

image

type: heading
heading_style: image
image: https://***.duckdns.org:8123/local/logo_hue_small.png
type: heading
heading_style: image
image: /api/image/serve/4ff06d926c08a36ccc8f7e2706f2fdca/512x512
type: heading
heading_style: image
image: /local/logo_hue_small.png

Additional information

- This PR fixes or closes issue: fixes #
- This PR is related to issue or discussion:
- Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@renzet renzet changed the title Added new heading_type "image" to Heading Card Add new heading_type "image" to Heading Card Jan 5, 2025
@piitaya
Copy link
Member

piitaya commented Jan 6, 2025

Hi 👋
The heading card is made up multiple elements : an icon, a text and a list of badges (entities).
What you propose is too different because it will replace the text and the icon by an image. Also, badges will not work with that.
A picture card already exists to display images (https://www.home-assistant.io/dashboards/picture/)

@bramkragten bramkragten requested a review from piitaya January 6, 2025 12:39
@bramkragten bramkragten closed this Jan 6, 2025
@renzet
Copy link
Author

renzet commented Jan 6, 2025

Hi piitaya,

Thanks for the review of my pullrequest. Unfortunately I don't fully understand why my proposal is "too different" from what is currently implemented in de Heading card, and why being different would be a bad thing. The way I see it the Heading card is very basic right now, with only an icon, a text and a list of badges (all of which are optional). My proposal indeed provides an alternative for the icon and text, so it can be customized with another font, color or whatever the user wants. Is it your opinion that a header should always contain an icon and text?

I also don't know why the badges don't work with this, according to my testing the badges still work the same way as before:

image

And I know the Picture card already exists, and I can use that as a header but then it is displayed just like a regular card so it doesn't look like a header:

image

I hope you'll reconsider this pullrequest.

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

Successfully merging this pull request may close these issues.

3 participants