-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Update entity naming in entity picker #24971
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
Conversation
bfd9ca8
to
511e177
Compare
This comment was marked as abuse.
This comment was marked as abuse.
c27cafe
to
76fb3b9
Compare
91e03a8
to
3e6455a
Compare
610b67b
to
2844ff1
Compare
$or: this._fuseKeys.map((key) => ({ [key]: term })), | ||
})), | ||
}); | ||
target.filteredItems = results.map((result) => result.item); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is no sorting by score, or is that done by fuse internal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Score is always 0. Fuse is unable to sort it as the query contains "or"
d5af88c
to
393bb51
Compare
@@ -57,6 +57,22 @@ export type HaEntityPickerEntityFilterFunc = (entity: HassEntity) => boolean; | |||
|
|||
const CREATE_ID = "___create-new-entity___"; | |||
|
|||
const DOMAIN_STYLE = styleMap({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still don't understand why it has to be a styleMap
, it is not dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For maintenance. Having a string make it hard to read and maintain. It's now outside of the component so it will be computed only once
Proposed change
Display entity name, device name, domain and area in the device picker.
When a entity is selected, the label is still the friendly_name. Only row items are changed.
The items are sorting by device name and entity name so the entity are grouped by device.
The entity ID not displayed because it's technical and it should not be needed for most users as more context has been added. However, you can still display it by enabling it with a dedicated setting in the profile.
It will end up with this result : the domain is removed and the entity is displayed in a third line.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: