From 57fb8f9f0196f83cc8ac2d8b0dee1d4ada0546da Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 25 Oct 2022 16:48:32 +0200 Subject: [PATCH] Adapt to energy sensors supporting GJ (#14181) --- src/data/recorder.ts | 2 +- .../energy/dialogs/dialog-energy-gas-settings.ts | 4 ++-- src/translations/en.json | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data/recorder.ts b/src/data/recorder.ts index 06b0ec91f4..5f7467ae33 100644 --- a/src/data/recorder.ts +++ b/src/data/recorder.ts @@ -67,7 +67,7 @@ export interface StatisticsValidationResultUnitsChanged { } export interface StatisticsUnitConfiguration { - energy?: "Wh" | "kWh" | "MWh"; + energy?: "Wh" | "kWh" | "MWh" | "GJ"; power?: "W" | "kW"; pressure?: | "Pa" diff --git a/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts b/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts index c0e37a46be..7135f538fa 100644 --- a/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts +++ b/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts @@ -81,9 +81,9 @@ export class DialogEnergyGasSettings const pickableUnit = this._pickableUnit || (this._params.allowedGasUnitClass === undefined - ? "ft³, m³, Wh, kWh or MWh" + ? "ft³, m³, Wh, kWh, MWh or GJ" : this._params.allowedGasUnitClass === "energy" - ? "Wh, kWh or MWh" + ? "Wh, kWh, MWh or GJ" : "ft³ or m³"); const externalSource = diff --git a/src/translations/en.json b/src/translations/en.json index f6c91344e2..c185daa664 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1497,7 +1497,7 @@ "cost_number": "Use a static price", "cost_number_input": "Price per {unit}", "gas_usage": "Gas usage", - "m3_or_kWh": "ft³, m³, Wh, kWh or MWh" + "m3_or_kWh": "ft³, m³, Wh, kWh, MWh or GJ" } }, "device_consumption": { @@ -1538,19 +1538,19 @@ }, "entity_unexpected_unit_energy": { "title": "Unexpected unit of measurement", - "description": "The following entities do not have the expected units of measurement 'Wh', 'kWh' or 'MWh':" + "description": "The following entities do not have the expected units of measurement 'Wh', 'kWh', 'MWh' or 'GJ':" }, "entity_unexpected_unit_gas": { "title": "Unexpected unit of measurement", - "description": "The following entities do not have the expected units of measurement 'Wh', 'kWh' or 'MWh' for an energy sensor or 'm³' or 'ft³' for a gas sensor:" + "description": "The following entities do not have the expected units of measurement 'Wh', 'kWh', 'MWh' or 'GJ' for an energy sensor or 'm³' or 'ft³' for a gas sensor:" }, "entity_unexpected_unit_energy_price": { "title": "Unexpected unit of measurement", - "description": "The following entities do not have the expected units of measurement ''{currency}/kWh'', ''{currency}/Wh'' or ''{currency}/MWh'':" + "description": "The following entities do not have the expected units of measurement ''{currency}/kWh'', ''{currency}/Wh'', ''{currency}/MWh'' or ''{currency}/GJ'':" }, "entity_unexpected_unit_gas_price": { "title": "Unexpected unit of measurement", - "description": "The following entities do not have the expected units of measurement ''{currency}/kWh'', ''{currency}/Wh'', ''{currency}/MWh'', ''{currency}/m³'' or ''{currency}/ft³'':" + "description": "The following entities do not have the expected units of measurement ''{currency}/kWh'', ''{currency}/Wh'', ''{currency}/MWh'', ''{currency}/GJ'', ''{currency}/m³'' or ''{currency}/ft³'':" }, "entity_unexpected_state_class": { "title": "Unexpected state class",