From 0a2eaec8842035b159c5fd112c86a3ae8fd56e93 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 18 Dec 2018 13:40:51 -0600 Subject: [PATCH] Cleanup of `picture` card editor (#2364) * Cleanup of `picture` card editor * Fix `action-editor` --- src/panels/lovelace/components/hui-action-editor.ts | 2 +- .../editor/config-elements/hui-picture-card-editor.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/components/hui-action-editor.ts b/src/panels/lovelace/components/hui-action-editor.ts index e7e2e6f4d5..7058a2ab73 100644 --- a/src/panels/lovelace/components/hui-action-editor.ts +++ b/src/panels/lovelace/components/hui-action-editor.ts @@ -34,7 +34,7 @@ export class HuiActionEditor extends LitElement { protected hass?: HomeAssistant; static get properties(): PropertyDeclarations { - return { hass: {}, config: {} }; + return { hass: {}, config: {}, label: {}, actions: {} }; } get _action(): string { diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts index 8d36e51727..52bba01b3c 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts @@ -44,7 +44,7 @@ export class HuiPictureCardEditor extends hassLocalizeLitMixin(LitElement) } get _tap_action(): ActionConfig { - return this._config!.tap_action || { action: "more-info" }; + return this._config!.tap_action || { action: "none" }; } get _hold_action(): ActionConfig { @@ -56,6 +56,8 @@ export class HuiPictureCardEditor extends hassLocalizeLitMixin(LitElement) return html``; } + const actions = ["navigate", "call-service", "none"]; + return html` ${configElementStyle}
@@ -70,15 +72,15 @@ export class HuiPictureCardEditor extends hassLocalizeLitMixin(LitElement) label="Tap Action" .hass="${this.hass}" .config="${this._tap_action}" - .actions="${["navigate", "call-service", "none"]}" + .actions="${actions}" .configValue="${"tap_action"}" @action-changed="${this._valueChanged}" >