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,45 +283,50 @@ 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"
${this.hass!.localize(
"ui.dialogs.zha_device_info.buttons.reconfigure"
)}
</mwc-button>
${this.showHelp
? html` ? html`
<div class="help-text"> <mwc-button @click=${this._onReconfigureNodeClick}>
${this.hass!.localize( ${this.hass!.localize(
"ui.dialogs.zha_device_info.services.reconfigure" "ui.dialogs.zha_device_info.buttons.reconfigure"
)} )}
</div> </mwc-button>
` ${this.showHelp
: ""} ? html`
<div class="help-text">
${this.hass!.localize(
"ui.dialogs.zha_device_info.services.reconfigure"
)}
</div>
`
: ""}
<ha-call-service-button <ha-call-service-button
.hass=${this.hass} .hass=${this.hass}
domain="zha" domain="zha"
service="remove" service="remove"
.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}"
>
${this.hass!.localize(
"ui.dialogs.zha_device_info.buttons.remove"
)}
</ha-call-service-button>
${this.showHelp
? html`
<div class="help-text">
${this.hass!.localize(
"ui.dialogs.zha_device_info.services.remove"
)} )}
</div> .serviceData=${this._serviceData}
>
${this.hass!.localize(
"ui.dialogs.zha_device_info.buttons.remove"
)}
</ha-call-service-button>
${this.showHelp
? html`
<div class="help-text">
${this.hass!.localize(
"ui.dialogs.zha_device_info.services.remove"
)}
</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>
` `