mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Fix for Entity SElector when supplying multiple domains (#11887)
Fix for Entity SElector when supplying multiple domains
This commit is contained in:
parent
c2994343b4
commit
4f6d7ca5c9
@ -51,10 +51,11 @@ export class HaEntitySelector extends SubscribeMixin(LitElement) {
|
|||||||
private _filterEntities = (entity: HassEntity): boolean => {
|
private _filterEntities = (entity: HassEntity): boolean => {
|
||||||
if (this.selector.entity?.domain) {
|
if (this.selector.entity?.domain) {
|
||||||
const filterDomain = this.selector.entity.domain;
|
const filterDomain = this.selector.entity.domain;
|
||||||
|
const filterDomainIsArray = Array.isArray(filterDomain);
|
||||||
const entityDomain = computeStateDomain(entity);
|
const entityDomain = computeStateDomain(entity);
|
||||||
if (
|
if (
|
||||||
(Array.isArray(filterDomain) && !filterDomain.includes(entityDomain)) ||
|
(filterDomainIsArray && !filterDomain.includes(entityDomain)) ||
|
||||||
entityDomain !== filterDomain
|
(!filterDomainIsArray && entityDomain !== filterDomain)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user