From 711d51c02297d9603d297b44d9019448b11b9aef Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Thu, 2 Jan 2020 07:24:40 -0500 Subject: [PATCH] Disable ZHA device binding buttons when a device to bind isn't selected (#4407) * only enable buttons when a device is selected * review comments --- src/panels/config/zha/zha-binding.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/panels/config/zha/zha-binding.ts b/src/panels/config/zha/zha-binding.ts index 21c7ea7965..3912a96c28 100644 --- a/src/panels/config/zha/zha-binding.ts +++ b/src/panels/config/zha/zha-binding.ts @@ -32,7 +32,7 @@ export class ZHABindingControl extends LitElement { @property() private _showHelp: boolean = false; @property() private _bindTargetIndex: number = -1; @property() private bindableDevices: ZHADevice[] = []; - private _deviceToBind?: ZHADevice; + @property() private _deviceToBind?: ZHADevice; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedDevice")) { @@ -83,7 +83,11 @@ export class ZHABindingControl extends LitElement { ` : ""}
- Bind + Bind ${this._showHelp ? html`
@@ -91,7 +95,9 @@ export class ZHABindingControl extends LitElement {
` : ""} - Unbind ${this._showHelp