From 764234f744c38d61daef994ee80add933f446c5f Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Tue, 7 Apr 2020 09:03:36 -0400 Subject: [PATCH] Icon pickers (#5453) --- .../config-elements/hui-button-card-editor.ts | 20 +++++++++++-------- .../config-elements/hui-entity-card-editor.ts | 9 ++++++--- .../config-elements/hui-sensor-card-editor.ts | 14 ++++++++----- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts index ace26dfa5f..d0f1299c17 100644 --- a/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-button-card-editor.ts @@ -10,6 +10,7 @@ import "@polymer/paper-input/paper-input"; import "../../components/hui-action-editor"; import "../../components/hui-theme-select-editor"; import "../../components/hui-entity-editor"; +import "../../../../components/ha-icon-input"; import { struct } from "../../common/structs/struct"; import { @@ -23,6 +24,7 @@ import { fireEvent } from "../../../../common/dom/fire_event"; import { configElementStyle } from "./config-elements-style"; import { ActionConfig } from "../../../../data/lovelace"; import { ButtonCardConfig } from "../../cards/types"; +import { stateIcon } from "../../../../common/entity/state_icon"; const cardConfigStruct = struct({ type: "string", @@ -127,16 +129,18 @@ export class HuiButtonCardEditor extends LitElement .configValue="${"name"}" @value-changed="${this._valueChanged}" > - + .value=${this._icon} + .placeholder=${this._icon || + stateIcon(this.hass.states[this._entity])} + .configValue=${"icon"} + @value-changed=${this._valueChanged} + >
- + >
- + .value=${this._icon} + .placeholder=${this._icon || + stateIcon(this.hass.states[this._entity])} + .configValue=${"icon"} + @value-changed=${this._valueChanged} + >