mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Fix filters for entity/device from integrations dashboard (#20953)
This commit is contained in:
parent
250f87cfd8
commit
f2b2da9877
@ -199,7 +199,9 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
|
||||
}
|
||||
|
||||
private _setFiltersFromUrl() {
|
||||
if (this._searchParms.has("domain")) {
|
||||
const domain = this._searchParms.get("domain");
|
||||
const configEntry = this._searchParms.get("config_entry");
|
||||
|
||||
this._filters = {
|
||||
...this._filters,
|
||||
"ha-filter-states": {
|
||||
@ -210,27 +212,15 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
|
||||
items: undefined,
|
||||
},
|
||||
"ha-filter-integrations": {
|
||||
value: [this._searchParms.get("domain")!],
|
||||
items: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
if (this._searchParms.has("config_entry")) {
|
||||
this._filters = {
|
||||
...this._filters,
|
||||
"ha-filter-states": {
|
||||
value: [
|
||||
...((this._filters["ha-filter-states"]?.value as string[]) || []),
|
||||
"disabled",
|
||||
],
|
||||
value: domain ? [domain] : [],
|
||||
items: undefined,
|
||||
},
|
||||
config_entry: {
|
||||
value: [this._searchParms.get("config_entry")!],
|
||||
value: configEntry ? [configEntry] : [],
|
||||
items: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (this._searchParms.has("label")) {
|
||||
this._filterLabel();
|
||||
}
|
||||
|
@ -943,6 +943,7 @@ ${
|
||||
}
|
||||
|
||||
protected firstUpdated() {
|
||||
this._setFiltersFromUrl();
|
||||
if (Object.keys(this._filters).length) {
|
||||
return;
|
||||
}
|
||||
@ -952,14 +953,15 @@ ${
|
||||
items: undefined,
|
||||
},
|
||||
};
|
||||
this._setFiltersFromUrl();
|
||||
fetchEntitySourcesWithCache(this.hass).then((sources) => {
|
||||
this._entitySources = sources;
|
||||
});
|
||||
}
|
||||
|
||||
private _setFiltersFromUrl() {
|
||||
if (this._searchParms.has("domain")) {
|
||||
const domain = this._searchParms.get("domain");
|
||||
const configEntry = this._searchParms.get("config_entry");
|
||||
|
||||
this._filters = {
|
||||
...this._filters,
|
||||
"ha-filter-states": {
|
||||
@ -967,24 +969,15 @@ ${
|
||||
items: undefined,
|
||||
},
|
||||
"ha-filter-integrations": {
|
||||
value: [this._searchParms.get("domain")!],
|
||||
items: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
if (this._searchParms.has("config_entry")) {
|
||||
this._filters = {
|
||||
...this._filters,
|
||||
"ha-filter-states": {
|
||||
value: [],
|
||||
value: domain ? [domain] : [],
|
||||
items: undefined,
|
||||
},
|
||||
config_entry: {
|
||||
value: [this._searchParms.get("config_entry")!],
|
||||
value: configEntry ? [configEntry] : [],
|
||||
items: undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (this._searchParms.has("label")) {
|
||||
this._filterLabel();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user