Link google assistant, alexa and cloud to cloud config (#13933)

This commit is contained in:
Bram Kragten 2022-09-30 20:52:20 +02:00 committed by GitHub
parent 9811f2681c
commit 650d579d05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 10 deletions

View File

@ -296,14 +296,13 @@ class AddIntegrationDialog extends LitElement {
scrimClickAction
escapeKeyAction
hideActions
.heading=${this._pickedBrand
? true
: createCloseHeading(
this.hass,
this.hass.localize("ui.panel.config.integrations.new")
)}
.heading=${createCloseHeading(
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">
<ha-icon-button-prev
@click=${this._prevClicked}
@ -533,6 +532,15 @@ class AddIntegrationDialog extends LitElement {
return;
}
if (
["cloud", "google_assistant", "alexa"].includes(integration.domain) &&
isComponentLoaded(this.hass, "cloud")
) {
this.closeDialog();
navigate("/config/cloud");
return;
}
const manifest = await fetchIntegrationManifest(
this.hass,
integration.domain

View File

@ -1,7 +1,9 @@
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { fireEvent } from "../../../common/dom/fire_event";
import { protocolIntegrationPicked } from "../../../common/integrations/protocolIntegrationPicked";
import { navigate } from "../../../common/navigate";
import { caseInsensitiveStringCompare } from "../../../common/string/compare";
import { localizeConfigFlowTitle } from "../../../data/config_flow";
import { DataEntryFlowProgress } from "../../../data/data_entry_flow";
@ -26,7 +28,7 @@ class HaDomainIntegrations extends LitElement {
@property() public domain!: string;
@property({ attribute: false }) public integration!: Integration;
@property({ attribute: false }) public integration?: Integration;
@property({ attribute: false })
public flowsInProgress?: DataEntryFlowProgress[];
@ -179,9 +181,19 @@ class HaDomainIntegrations extends LitElement {
private async _integrationPicked(ev) {
const domain = ev.currentTarget.domain;
if (
(domain === this.domain && !this.integration.config_flow) ||
!this.integration.integrations?.[domain]?.config_flow
["cloud", "google_assistant", "alexa"].includes(domain) &&
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);
showAlertDialog(this, {