mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-27 04:26:34 +00:00
Link discovered homekit devices to domain (#13950)
This commit is contained in:
parent
dd695545d3
commit
c14d9ab957
@ -509,7 +509,16 @@ class AddIntegrationDialog extends LitElement {
|
|||||||
if (integration.integrations) {
|
if (integration.integrations) {
|
||||||
const integrations =
|
const integrations =
|
||||||
this._integrations![integration.domain].integrations!;
|
this._integrations![integration.domain].integrations!;
|
||||||
this._fetchFlowsInProgress(Object.keys(integrations));
|
let domains = Object.keys(integrations);
|
||||||
|
if (integration.iot_standards?.includes("homekit")) {
|
||||||
|
// if homekit is supported, also fetch the discovered homekit devices
|
||||||
|
domains.push("homekit_controller");
|
||||||
|
}
|
||||||
|
if (integration.domain === "apple") {
|
||||||
|
// we show discoverd homekit devices in their own brand section, dont show them at apple
|
||||||
|
domains = domains.filter((domain) => domain !== "homekit_controller");
|
||||||
|
}
|
||||||
|
this._fetchFlowsInProgress(domains);
|
||||||
this._pickedBrand = integration.domain;
|
this._pickedBrand = integration.domain;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -603,7 +612,14 @@ class AddIntegrationDialog extends LitElement {
|
|||||||
private async _fetchFlowsInProgress(domains: string[]) {
|
private async _fetchFlowsInProgress(domains: string[]) {
|
||||||
const flowsInProgress = (
|
const flowsInProgress = (
|
||||||
await fetchConfigFlowInProgress(this.hass.connection)
|
await fetchConfigFlowInProgress(this.hass.connection)
|
||||||
).filter((flow) => domains.includes(flow.handler));
|
).filter(
|
||||||
|
(flow) =>
|
||||||
|
// filter config flows that are not for the integration we are looking for
|
||||||
|
domains.includes(flow.handler) ||
|
||||||
|
// filter config flows of other domains (like homekit) that are for the domains we are looking for
|
||||||
|
("alternative_domain" in flow.context &&
|
||||||
|
domains.includes(flow.context.alternative_domain))
|
||||||
|
);
|
||||||
|
|
||||||
if (flowsInProgress.length) {
|
if (flowsInProgress.length) {
|
||||||
this._flowsInProgress = flowsInProgress;
|
this._flowsInProgress = flowsInProgress;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user