mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix unit label for static grid energy price (#17508)
This commit is contained in:
parent
945c8e0320
commit
827a57499b
@ -227,7 +227,7 @@ export class DialogEnergyGasSettings
|
|||||||
"ui.panel.config.energy.gas.dialog.cost_number_input"
|
"ui.panel.config.energy.gas.dialog.cost_number_input"
|
||||||
)} ${unitPrice ? ` (${unitPrice})` : ""}`}
|
)} ${unitPrice ? ` (${unitPrice})` : ""}`}
|
||||||
class="price-options"
|
class="price-options"
|
||||||
step=".01"
|
step="any"
|
||||||
type="number"
|
type="number"
|
||||||
.value=${this._source.number_energy_price}
|
.value=${this._source.number_energy_price}
|
||||||
@change=${this._numberPriceChanged}
|
@change=${this._numberPriceChanged}
|
||||||
|
@ -96,10 +96,12 @@ export class DialogEnergyGridFlowSettings
|
|||||||
|
|
||||||
const pickableUnit = this._energy_units?.join(", ") || "";
|
const pickableUnit = this._energy_units?.join(", ") || "";
|
||||||
|
|
||||||
const unitPrice = this._pickedDisplayUnit
|
const unitPriceSensor = this._pickedDisplayUnit
|
||||||
? `${this.hass.config.currency}/${this._pickedDisplayUnit}`
|
? `${this.hass.config.currency}/${this._pickedDisplayUnit}`
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
const unitPriceFixed = `${this.hass.config.currency}/kWh`;
|
||||||
|
|
||||||
const externalSource =
|
const externalSource =
|
||||||
this._source[
|
this._source[
|
||||||
this._params.direction === "from"
|
this._params.direction === "from"
|
||||||
@ -223,7 +225,7 @@ export class DialogEnergyGridFlowSettings
|
|||||||
.value=${this._source.entity_energy_price}
|
.value=${this._source.entity_energy_price}
|
||||||
.label=${`${this.hass.localize(
|
.label=${`${this.hass.localize(
|
||||||
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_entity_input`
|
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_entity_input`
|
||||||
)} ${unitPrice ? ` (${unitPrice})` : ""}`}
|
)} ${unitPriceSensor ? ` (${unitPriceSensor})` : ""}`}
|
||||||
@value-changed=${this._priceEntityChanged}
|
@value-changed=${this._priceEntityChanged}
|
||||||
></ha-entity-picker>`
|
></ha-entity-picker>`
|
||||||
: ""}
|
: ""}
|
||||||
@ -244,12 +246,12 @@ export class DialogEnergyGridFlowSettings
|
|||||||
? html`<ha-textfield
|
? html`<ha-textfield
|
||||||
.label=${`${this.hass.localize(
|
.label=${`${this.hass.localize(
|
||||||
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_input`
|
`ui.panel.config.energy.grid.flow_dialog.${this._params.direction}.cost_number_input`
|
||||||
)} ${unitPrice ? ` (${unitPrice})` : ""}`}
|
)} (${unitPriceFixed})`}
|
||||||
class="price-options"
|
class="price-options"
|
||||||
step=".01"
|
step="any"
|
||||||
type="number"
|
type="number"
|
||||||
.value=${this._source.number_energy_price}
|
.value=${this._source.number_energy_price}
|
||||||
.suffix=${unitPrice || ""}
|
.suffix=${unitPriceFixed}
|
||||||
@change=${this._numberPriceChanged}
|
@change=${this._numberPriceChanged}
|
||||||
>
|
>
|
||||||
</ha-textfield>`
|
</ha-textfield>`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user