mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix yaml editor behavior of statistics graph card (#15742)
This commit is contained in:
parent
40b9e62a87
commit
98e21370fd
@ -30,6 +30,9 @@ export class HaStatisticPicker extends LitElement {
|
||||
@property({ attribute: "statistic-types" })
|
||||
public statisticTypes?: "mean" | "sum";
|
||||
|
||||
@property({ type: Boolean, attribute: "allow-custom-entity" })
|
||||
public allowCustomEntity;
|
||||
|
||||
@property({ type: Array }) public statisticIds?: StatisticsMetaData[];
|
||||
|
||||
@property({ type: Boolean }) public disabled?: boolean;
|
||||
@ -245,6 +248,7 @@ export class HaStatisticPicker extends LitElement {
|
||||
.value=${this._value}
|
||||
.renderer=${this._rowRenderer}
|
||||
.disabled=${this.disabled}
|
||||
.allowCustomValue=${this.allowCustomEntity}
|
||||
item-value-path="id"
|
||||
item-id-path="id"
|
||||
item-label-path="name"
|
||||
|
@ -22,6 +22,9 @@ class HaStatisticsPicker extends LitElement {
|
||||
@property({ attribute: "pick-statistic-label" })
|
||||
public pickStatisticLabel?: string;
|
||||
|
||||
@property({ type: Boolean, attribute: "allow-custom-entity" })
|
||||
public allowCustomEntity;
|
||||
|
||||
/**
|
||||
* Show only statistics natively stored with these units of measurements.
|
||||
* @attr include-statistics-unit-of-measurement
|
||||
@ -88,6 +91,7 @@ class HaStatisticsPicker extends LitElement {
|
||||
.statisticTypes=${includeStatisticTypesCurrent}
|
||||
.statisticIds=${this.statisticIds}
|
||||
.label=${this.pickedStatisticLabel}
|
||||
.allowCustomEntity=${this.allowCustomEntity}
|
||||
@value-changed=${this._statisticChanged}
|
||||
></ha-statistic-picker>
|
||||
</div>
|
||||
@ -103,6 +107,7 @@ class HaStatisticsPicker extends LitElement {
|
||||
.statisticTypes=${this.statisticTypes}
|
||||
.statisticIds=${this.statisticIds}
|
||||
.label=${this.pickStatisticLabel}
|
||||
.allowCustomEntity=${this.allowCustomEntity}
|
||||
@value-changed=${this._addStatistic}
|
||||
></ha-statistic-picker>
|
||||
</div>
|
||||
|
@ -274,6 +274,7 @@ export class HuiStatisticsGraphCardEditor
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-form>
|
||||
<ha-statistics-picker
|
||||
allow-custom-entity
|
||||
.hass=${this.hass}
|
||||
.pickStatisticLabel=${this.hass!.localize(
|
||||
"ui.panel.lovelace.editor.card.statistics-graph.pick_statistic"
|
||||
|
Loading…
x
Reference in New Issue
Block a user