mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 12:56:37 +00:00
Link google assistant, alexa and cloud to cloud config (#13933)
This commit is contained in:
parent
9811f2681c
commit
650d579d05
@ -296,14 +296,13 @@ class AddIntegrationDialog extends LitElement {
|
|||||||
scrimClickAction
|
scrimClickAction
|
||||||
escapeKeyAction
|
escapeKeyAction
|
||||||
hideActions
|
hideActions
|
||||||
.heading=${this._pickedBrand
|
.heading=${createCloseHeading(
|
||||||
? true
|
this.hass,
|
||||||
: createCloseHeading(
|
this.hass.localize("ui.panel.config.integrations.new")
|
||||||
this.hass,
|
)}
|
||||||
this.hass.localize("ui.panel.config.integrations.new")
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
${this._pickedBrand
|
${this._pickedBrand &&
|
||||||
|
(!this._integrations || this._pickedBrand in this._integrations)
|
||||||
? html`<div slot="heading">
|
? html`<div slot="heading">
|
||||||
<ha-icon-button-prev
|
<ha-icon-button-prev
|
||||||
@click=${this._prevClicked}
|
@click=${this._prevClicked}
|
||||||
@ -533,6 +532,15 @@ class AddIntegrationDialog extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
["cloud", "google_assistant", "alexa"].includes(integration.domain) &&
|
||||||
|
isComponentLoaded(this.hass, "cloud")
|
||||||
|
) {
|
||||||
|
this.closeDialog();
|
||||||
|
navigate("/config/cloud");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const manifest = await fetchIntegrationManifest(
|
const manifest = await fetchIntegrationManifest(
|
||||||
this.hass,
|
this.hass,
|
||||||
integration.domain
|
integration.domain
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
|
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { protocolIntegrationPicked } from "../../../common/integrations/protocolIntegrationPicked";
|
import { protocolIntegrationPicked } from "../../../common/integrations/protocolIntegrationPicked";
|
||||||
|
import { navigate } from "../../../common/navigate";
|
||||||
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
|
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
|
||||||
import { localizeConfigFlowTitle } from "../../../data/config_flow";
|
import { localizeConfigFlowTitle } from "../../../data/config_flow";
|
||||||
import { DataEntryFlowProgress } from "../../../data/data_entry_flow";
|
import { DataEntryFlowProgress } from "../../../data/data_entry_flow";
|
||||||
@ -26,7 +28,7 @@ class HaDomainIntegrations extends LitElement {
|
|||||||
|
|
||||||
@property() public domain!: string;
|
@property() public domain!: string;
|
||||||
|
|
||||||
@property({ attribute: false }) public integration!: Integration;
|
@property({ attribute: false }) public integration?: Integration;
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
public flowsInProgress?: DataEntryFlowProgress[];
|
public flowsInProgress?: DataEntryFlowProgress[];
|
||||||
@ -179,9 +181,19 @@ class HaDomainIntegrations extends LitElement {
|
|||||||
|
|
||||||
private async _integrationPicked(ev) {
|
private async _integrationPicked(ev) {
|
||||||
const domain = ev.currentTarget.domain;
|
const domain = ev.currentTarget.domain;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(domain === this.domain && !this.integration.config_flow) ||
|
["cloud", "google_assistant", "alexa"].includes(domain) &&
|
||||||
!this.integration.integrations?.[domain]?.config_flow
|
isComponentLoaded(this.hass, "cloud")
|
||||||
|
) {
|
||||||
|
fireEvent(this, "close-dialog");
|
||||||
|
navigate("/config/cloud");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(domain === this.domain && !this.integration!.config_flow) ||
|
||||||
|
!this.integration!.integrations?.[domain]?.config_flow
|
||||||
) {
|
) {
|
||||||
const manifest = await fetchIntegrationManifest(this.hass, domain);
|
const manifest = await fetchIntegrationManifest(this.hass, domain);
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user