Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/entity/ha-entity-attribute-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class HaEntityAttributePicker extends LitElement {
.value=${this._value}
.allowCustomValue=${this.allowCustomValue}
.renderer=${rowRenderer}
attr-for-value="bind-value"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without that line, the value was not shown in the input until you clicked into the field. All existing usages of <ha-entity-attribute-picker> in the code base set the attribute allow-custom-value. With that set, it works fine, but without this additional option was required.

@opened-changed=${this._openedChanged}
@value-changed=${this._valueChanged}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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(
Expand All @@ -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"
Expand Down