Skip to content

Conversation

pcan08
Copy link
Contributor

@pcan08 pcan08 commented Aug 20, 2025

Breaking change

Proposed change

In the tile card editor, I propose to add a switch to set the tile name to the area name of the selected entity.

I guess it is a common use case to create tiles in a section for the same type of entity of different areas, this could help to speed up a little bit the tile configuration.

Capture d’écran du 2025-08-20 08-56-33 Capture d’écran du 2025-08-20 08-56-45

Set the switch ON change the value of the name input field.
If the entity does not have area, the switch is set to OFF and disabled, the name input filed keep its previous value (behavior before this PR)

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

type: tile
entity: switch.0xdc8e95fffe013356
icon: mdi:globe-light
name: Cuisine
features_position: bottom
vertical: false
use_entity_area_name: true

Additional information

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:

pcan08 added 3 commits August 20, 2025 06:37
IA was used to get entity area name, but i guess there is a better option, look forward for it
deliberately keep comments for now, need clean up
Simplify entity area detection by replacing custom area lookup logic with the existing getEntityEntryContext function
@piitaya
Copy link
Member

piitaya commented Aug 25, 2025

Hi 👋 Thank your for the contribution.
As we introduced new naming in the picker few releases ago (e.g. in the entity picker : #24971), I would be nice to be able to customize the name display using entity, device, area and floor name.

I discussed with the UX team already the idea is not to limit it to area only. We should propose some presets of entity, device area combination or let the users build their own using some kind of template. The idea is to propose it on every card instead of only tile card.

CleanShot 2025-08-25 at 17 44 08

I have it on my todo list. Is it something I should work on or would you like to do it (it is way much work than this PR 😅)?

@pcan08
Copy link
Contributor Author

pcan08 commented Aug 25, 2025

I can give it a try but not for the incoming release.

My first idea was to make a combobox like the picker you show with the area name and the capability to enter a custom name, but I was not ready 😅 I am still learning and discovering the frontend code. So I simplified it as much as possible 😀
Are there any guidance i should know ?

Edit: I took a look at the gallery, I'll propose something as soon as I have a moment.

@pcan08
Copy link
Contributor Author

pcan08 commented Aug 26, 2025

I just saw PR #26696 , isn't it partillay competing with the discussion we have here ? 🤔

@MindFreeze
Copy link
Member

I just saw PR #26696 , isn't it partillay competing with the discussion we have here ? 🤔

Yes. This is very new but seems to be going well. So I suggest you wait until we merge it. Then the predefined name options can just set a template for the name. For example selecting "Area" sets the name to "{{ area_name(entity_id) }}"

@pcan08
Copy link
Contributor Author

pcan08 commented Aug 26, 2025

Hmmm, I did this (in another branch not yet PR):

Capture.video.du.2025-08-26.19-21-57.mp4

How to proceed for the next step ? Do you want I wait or do you prefer I open a new PR with this new proposal (that should be completed with combination) ?

I think we have finish with this PR, I propose to discard it, but I'd like you guide me for the process to follow for next step if you don't mind

@MindFreeze
Copy link
Member

This looks great. Yes, we can close this PR and create a new one with the new UI. But first we need to merge the template support and to implement that on the tile card (will be a separate PR once we agree on the UX). Then you can add the dropdown and have it construct a template. This way you will only need to change the editor to achieve your goal.

@pcan08
Copy link
Contributor Author

pcan08 commented Aug 27, 2025

I discard it in favor of #26722, please take a look at it even if it is a draft

@pcan08 pcan08 closed this Aug 27, 2025
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