From bd98ce8c25e7296093ce51fb4b79be40920c2d5e Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Fri, 10 Apr 2020 05:57:23 -0400 Subject: [PATCH] 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 * Update src/panels/config/zha/zha-device-card.ts Co-Authored-By: Zack Arnett Co-authored-by: Bram Kragten Co-authored-by: Zack Arnett --- src/panels/config/zha/zha-add-devices-page.ts | 2 +- src/panels/config/zha/zha-device-card.ts | 67 ++++++++++--------- src/panels/config/zha/zha-node.ts | 2 +- 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/panels/config/zha/zha-add-devices-page.ts b/src/panels/config/zha/zha-add-devices-page.ts index 05d627c80a..f4a4765828 100644 --- a/src/panels/config/zha/zha-add-devices-page.ts +++ b/src/panels/config/zha/zha-add-devices-page.ts @@ -170,7 +170,7 @@ class ZHAAddDevicesPage extends LitElement { this._active = true; this._addDevicesTimeoutHandle = setTimeout( () => this._unsubscribe(), - 75000 + 120000 ); } diff --git a/src/panels/config/zha/zha-device-card.ts b/src/panels/config/zha/zha-device-card.ts index ec00a3de10..312fe982c1 100644 --- a/src/panels/config/zha/zha-device-card.ts +++ b/src/panels/config/zha/zha-device-card.ts @@ -283,45 +283,50 @@ class ZHADeviceCard extends LitElement { this.showActions ? html`
- - ${this.hass!.localize( - "ui.dialogs.zha_device_info.buttons.reconfigure" - )} - - ${this.showHelp + ${this.device!.device_type !== "Coordinator" ? html` -
+ ${this.hass!.localize( - "ui.dialogs.zha_device_info.services.reconfigure" + "ui.dialogs.zha_device_info.buttons.reconfigure" )} -
- ` - : ""} + + ${this.showHelp + ? html` +
+ ${this.hass!.localize( + "ui.dialogs.zha_device_info.services.reconfigure" + )} +
+ ` + : ""} - - ${this.hass!.localize( - "ui.dialogs.zha_device_info.buttons.remove" - )} - - ${this.showHelp - ? html` -
- ${this.hass!.localize( - "ui.dialogs.zha_device_info.services.remove" + + .serviceData=${this._serviceData} + > + ${this.hass!.localize( + "ui.dialogs.zha_device_info.buttons.remove" + )} + + ${this.showHelp + ? html` +
+ ${this.hass!.localize( + "ui.dialogs.zha_device_info.services.remove" + )} +
+ ` + : ""} ` : ""} ${this.device!.power_source === "Mains" && - this.device!.device_type === "Router" + (this.device!.device_type === "Router" || + this.device!.device_type === "Coordinator") ? html` ${this.hass!.localize( diff --git a/src/panels/config/zha/zha-node.ts b/src/panels/config/zha/zha-node.ts index b0f1468369..d7b93438d7 100644 --- a/src/panels/config/zha/zha-node.ts +++ b/src/panels/config/zha/zha-node.ts @@ -67,7 +67,7 @@ export class ZHANode extends LitElement { showName showModelInfo .showEntityDetail=${false} - .showActions="${this.device.device_type !== "Coordinator"}" + showActions @zha-device-removed=${this._onDeviceRemoved} > `