Make add devices button available on ZHA coordinator (#5431)

* Make add devices available on ZHA coordinator

* Update src/panels/config/zha/zha-device-card.ts

Co-Authored-By: Bram Kragten <mail@bramkragten.nl>

* Update src/panels/config/zha/zha-device-card.ts

Co-Authored-By: Zack Arnett <arnett.zackary@gmail.com>

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
Co-authored-by: Zack Arnett <arnett.zackary@gmail.com>
This commit is contained in:
David F. Mulcahey 2020-04-10 05:57:23 -04:00 committed by GitHub
parent 0c1714ef78
commit bd98ce8c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 33 deletions

View File

@ -170,7 +170,7 @@ class ZHAAddDevicesPage extends LitElement {
this._active = true; this._active = true;
this._addDevicesTimeoutHandle = setTimeout( this._addDevicesTimeoutHandle = setTimeout(
() => this._unsubscribe(), () => this._unsubscribe(),
75000 120000
); );
} }

View File

@ -283,7 +283,9 @@ class ZHADeviceCard extends LitElement {
this.showActions this.showActions
? html` ? html`
<div class="card-actions"> <div class="card-actions">
<mwc-button @click="${this._onReconfigureNodeClick}"> ${this.device!.device_type !== "Coordinator"
? html`
<mwc-button @click=${this._onReconfigureNodeClick}>
${this.hass!.localize( ${this.hass!.localize(
"ui.dialogs.zha_device_info.buttons.reconfigure" "ui.dialogs.zha_device_info.buttons.reconfigure"
)} )}
@ -305,7 +307,7 @@ class ZHADeviceCard extends LitElement {
.confirmation=${this.hass!.localize( .confirmation=${this.hass!.localize(
"ui.dialogs.zha_device_info.confirmations.remove" "ui.dialogs.zha_device_info.confirmations.remove"
)} )}
.serviceData="${this._serviceData}" .serviceData=${this._serviceData}
> >
${this.hass!.localize( ${this.hass!.localize(
"ui.dialogs.zha_device_info.buttons.remove" "ui.dialogs.zha_device_info.buttons.remove"
@ -320,8 +322,11 @@ class ZHADeviceCard extends LitElement {
</div> </div>
` `
: ""} : ""}
`
: ""}
${this.device!.power_source === "Mains" && ${this.device!.power_source === "Mains" &&
this.device!.device_type === "Router" (this.device!.device_type === "Router" ||
this.device!.device_type === "Coordinator")
? html` ? html`
<mwc-button @click=${this._onAddDevicesClick}> <mwc-button @click=${this._onAddDevicesClick}>
${this.hass!.localize( ${this.hass!.localize(

View File

@ -67,7 +67,7 @@ export class ZHANode extends LitElement {
showName showName
showModelInfo showModelInfo
.showEntityDetail=${false} .showEntityDetail=${false}
.showActions="${this.device.device_type !== "Coordinator"}" showActions
@zha-device-removed=${this._onDeviceRemoved} @zha-device-removed=${this._onDeviceRemoved}
></zha-device-card> ></zha-device-card>
` `