;
}
diff --git a/src/panels/config/energy/ha-config-energy.ts b/src/panels/config/energy/ha-config-energy.ts
index 3b81c275c..d55210dcd 100644
--- a/src/panels/config/energy/ha-config-energy.ts
+++ b/src/panels/config/energy/ha-config-energy.ts
@@ -1,22 +1,15 @@
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property, state } from "lit/decorators";
-
import "../../../components/ha-svg-icon";
-import {
- EnergyPreferences,
- getEnergyPreferences,
- saveEnergyPreferences,
-} from "../../../data/energy";
-
+import { EnergyPreferences, getEnergyPreferences } from "../../../data/energy";
import "../../../layouts/hass-loading-screen";
import "../../../layouts/hass-tabs-subpage";
import { haStyle } from "../../../resources/styles";
import type { HomeAssistant, Route } from "../../../types";
import { configSections } from "../ha-panel-config";
+import "./components/ha-energy-device-settings";
import "./components/ha-energy-grid-settings";
import "./components/ha-energy-solar-settings";
-import "./components/ha-energy-device-settings";
-import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box";
const INITIAL_CONFIG = {
currency: "€",
@@ -72,18 +65,6 @@ class HaConfigEnergy extends LitElement {
.route=${this.route}
.tabs=${configSections.experiences}
>
-
-
-
- ${this._config!.prefs.currency} ${cost.toFixed(2)}
+ ${formatNumber(cost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })}
`;
})}
@@ -162,7 +166,10 @@ export class HuiEnergyCostsTableCard
|
- ${this._config!.prefs.currency} ${cost.toFixed(2)}
+ ${formatNumber(cost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })}
|
`;
})}
@@ -172,7 +179,10 @@ export class HuiEnergyCostsTableCard
${round(totalEnergy)} kWh
- ${this._config!.prefs.currency} ${totalCost.toFixed(2)}
+ ${formatNumber(totalCost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })}
|
diff --git a/src/panels/lovelace/cards/energy/hui-energy-summary-card.ts b/src/panels/lovelace/cards/energy/hui-energy-summary-card.ts
index 9fd7dd20e..60179e94f 100644
--- a/src/panels/lovelace/cards/energy/hui-energy-summary-card.ts
+++ b/src/panels/lovelace/cards/energy/hui-energy-summary-card.ts
@@ -171,7 +171,7 @@ class HuiEnergySummaryCard extends LitElement implements LovelaceCard {
types
.grid![0].flow_from.map((flow) => flow.stat_cost)
.filter(Boolean) as string[],
- prefs.currency
+ this.hass.config.currency!
)}