From e3b18a33ca37e69af536078ef42efaba91a30024 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Wed, 9 Sep 2020 20:49:56 +0200 Subject: [PATCH] Disable "Execute" if automation is unavailable (#6866) --- src/dialogs/more-info/controls/more-info-automation.ts | 5 ++++- src/panels/config/automation/ha-automation-picker.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-automation.ts b/src/dialogs/more-info/controls/more-info-automation.ts index 8a25e93fe4..a63a10d819 100644 --- a/src/dialogs/more-info/controls/more-info-automation.ts +++ b/src/dialogs/more-info/controls/more-info-automation.ts @@ -34,7 +34,10 @@ class MoreInfoAutomation extends LitElement {
- + ${this.hass.localize("ui.card.automation.trigger")}
diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index e56b62fe2b..221f7f1e14 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -91,10 +91,11 @@ class HaAutomationPicker extends LitElement { if (!narrow) { columns.execute = { title: "", - template: (_info, automation) => html` + template: (_info, automation: any) => html` this._execute(ev)} + .disabled=${automation.state === "unavailable"} > ${this.hass.localize("ui.card.automation.trigger")}