mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Use domain translation in filter for domain search (#20763)
* Use domain translation in filter for domain search
This commit is contained in:
parent
1b4534890c
commit
111816f08a
@ -87,8 +87,14 @@ export class HaFilterDomains extends LitElement {
|
|||||||
Object.keys(states).forEach((entityId) => {
|
Object.keys(states).forEach((entityId) => {
|
||||||
domains.add(computeDomain(entityId));
|
domains.add(computeDomain(entityId));
|
||||||
});
|
});
|
||||||
return Array.from(domains)
|
|
||||||
.filter((domain) => !filter || domain.toLowerCase().includes(filter))
|
return Array.from(domains.values())
|
||||||
|
.filter(
|
||||||
|
(entry) =>
|
||||||
|
!filter ||
|
||||||
|
entry.toLowerCase().includes(filter) ||
|
||||||
|
domainToName(this.hass.localize, entry).toLowerCase().includes(filter)
|
||||||
|
)
|
||||||
.sort((a, b) => stringCompare(a, b, this.hass.locale.language));
|
.sort((a, b) => stringCompare(a, b, this.hass.locale.language));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user