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