Use attribute picker for sec. info in weather card editor (#7335)

This commit is contained in:
Philip Allgaier 2020-10-15 00:57:30 +02:00 committed by GitHub
parent f6ff652ca4
commit 4a7fb3d509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -80,6 +80,7 @@ class HaEntityAttributePicker extends LitElement {
.value=${this._value}
.allowCustomValue=${this.allowCustomValue}
.renderer=${rowRenderer}
attr-for-value="bind-value"
@opened-changed=${this._openedChanged}
@value-changed=${this._valueChanged}
>

View File

@ -13,6 +13,7 @@ import { computeRTLDirection } from "../../../../common/util/compute_rtl";
import "../../../../components/entity/ha-entity-picker";
import "../../../../components/ha-formfield";
import "../../../../components/ha-switch";
import "../../../../components/entity/ha-entity-attribute-picker";
import { HomeAssistant } from "../../../../types";
import { WeatherForecastCardConfig } from "../../cards/types";
import "../../components/hui-theme-select-editor";
@ -102,7 +103,9 @@ export class HuiWeatherForecastCardEditor extends LitElement
></hui-theme-select-editor>
</div>
<div class="side-by-side">
<paper-input
<ha-entity-attribute-picker
.hass=${this.hass}
.entityId=${this._entity}
.label="${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.secondary_info_attribute"
)} (${this.hass.localize(
@ -111,7 +114,7 @@ export class HuiWeatherForecastCardEditor extends LitElement
.value=${this._secondary_info_attribute}
.configValue=${"secondary_info_attribute"}
@value-changed=${this._valueChanged}
></paper-input>
></ha-entity-attribute-picker>
<ha-formfield
.label=${this.hass.localize(
"ui.panel.lovelace.editor.card.weather-forecast.show_forecast"