Skip to content

Commit b728e23

Browse files
authored
Battery grid charge: show configured limit (#18032)
1 parent eaff6de commit b728e23

File tree

21 files changed

+29
-49
lines changed

21 files changed

+29
-49
lines changed

assets/js/components/Energyflow/Energyflow.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
data-testid="energyflow-entry-batterydischarge"
104104
@details-clicked="openBatterySettingsModal"
105105
>
106-
<template v-if="batteryGridChargeActive" #subline>
106+
<template v-if="batteryGridChargeLimitSet" #subline>
107107
<div class="d-none d-md-block">&nbsp;</div>
108108
</template>
109109
</EnergyflowEntry>
@@ -177,13 +177,25 @@
177177
detailsClickable
178178
@details-clicked="openBatterySettingsModal"
179179
>
180-
<template v-if="batteryGridChargeActive" #subline>
180+
<template v-if="batteryGridChargeLimitSet" #subline>
181181
<button
182182
type="button"
183-
class="btn-reset d-flex justify-content-between"
183+
class="btn-reset d-flex justify-content-between text-start pe-4"
184184
@click.stop="openBatterySettingsModal"
185185
>
186-
{{ batteryGridChargeText }} (≤ {{ batteryGridChargeLimitFmt }})
186+
<span v-if="batteryGridChargeActive">
187+
{{ $t("main.energyflow.batteryGridChargeActive") }}
188+
<span class="text-nowrap"
189+
>(≤ <u>{{ batteryGridChargeLimitFmt }}</u
190+
>)</span
191+
>
192+
</span>
193+
<span v-else>
194+
{{ $t("main.energyflow.batteryGridChargeLimit") }}
195+
<span class="text-nowrap"
196+
>≤ <u>{{ batteryGridChargeLimitFmt }}</u></span
197+
>
198+
</span>
187199
</button>
188200
</template>
189201
</EnergyflowEntry>
@@ -341,19 +353,17 @@ export default {
341353
pvPossible() {
342354
return this.pvConfigured || this.gridConfigured;
343355
},
344-
batteryGridChargeText() {
345-
return this.$t(
346-
`main.energyflow.${this.co2Available ? "clean" : "cheap"}BatteryGridCharge`
347-
);
348-
},
349356
batteryGridChargeNow() {
350357
if (this.co2Available) {
351358
return this.fmtCo2Short(this.tariffCo2);
352359
}
353360
return this.fmtPricePerKWh(this.tariffGrid, this.currency, true);
354361
},
362+
batteryGridChargeLimitSet() {
363+
return this.batteryGridChargeLimit !== null;
364+
},
355365
batteryGridChargeLimitFmt() {
356-
if (this.batteryGridChargeLimit === null) {
366+
if (!this.batteryGridChargeLimitSet) {
357367
return;
358368
}
359369
if (this.co2Available) {

i18n/bg.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ batteryCharge = "Зареждане на батерията"
418418
batteryDischarge = "Разреждане на батерията"
419419
batteryHold = "Батерия (заключена)"
420420
batteryTooltip = "{energy} от {total} ({soc})"
421-
cheapBatteryGridCharge = "евтина мрежова енергия"
422-
cleanBatteryGridCharge = "чиста мрежова енергия"
423421
gridImport = "Използвана енергия от мрежата"
424422
homePower = "Потребление"
425423
loadpoints = "Зарядно устройство | Зарядно устройство | {count} зарядни устройства"

i18n/da.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ batteryCharge = "Batteriet oplades"
423423
batteryDischarge = "Batteriet aflades"
424424
batteryHold = "Batteri (låst)"
425425
batteryTooltip = "{energi} af {total} ({soc})"
426-
cheapBatteryGridCharge = "billig strøm på elnettet"
427-
cleanBatteryGridCharge = "Grøn strøm på elnettet"
428426
gridImport = "Forbrug fra elnet"
429427
homePower = "Forbrug"
430428
loadpoints = "Oplader| Oplader | {count} opladere"

i18n/de.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ weekdays = "Tage"
408408
battery = "Batterie"
409409
batteryCharge = "Batterie laden"
410410
batteryDischarge = "Batterie entladen"
411+
batteryGridChargeActive = "Netzladen aktiv"
412+
batteryGridChargeLimit = "Netzladen wenn"
411413
batteryHold = "Batterie (gesperrt)"
412414
batteryTooltip = "{energy} von {total} ({soc})"
413-
cheapBatteryGridCharge = "günstige Netzenergie"
414-
cleanBatteryGridCharge = "saubere Netzenergie"
415415
gridImport = "Netzbezug"
416416
homePower = "Verbrauch"
417417
loadpoints = "Ladepunkt | Ladepunkt | {count} Ladepunkte"

i18n/el.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@ batteryCharge = "Φόρτιση μπαταρίας"
410410
batteryDischarge = "Αποφόρτιση μπαταρίας"
411411
batteryHold = "Μπαταρία (κλειδωμένο)"
412412
batteryTooltip = "{energy} από {total} ({soc})"
413-
cheapBatteryGridCharge = "φθηνή ενέργεια δικτύου"
414-
cleanBatteryGridCharge = "πράσινη ενέργεια δικτύου"
415413
gridImport = "Χρήση δικτύου"
416414
homePower = "Κατανάλωση"
417415
loadpoints = "Φορτιστής| Φορτιστής | {count} φορτιστές"

i18n/en.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,10 @@ weekdays = "Days"
407407
battery = "Battery"
408408
batteryCharge = "Battery charging"
409409
batteryDischarge = "Battery discharging"
410+
batteryGridChargeActive = "grid charging active"
411+
batteryGridChargeLimit = "grid charging when"
410412
batteryHold = "Battery (locked)"
411413
batteryTooltip = "{energy} of {total} ({soc})"
412-
cheapBatteryGridCharge = "cheap grid energy"
413-
cleanBatteryGridCharge = "clean grid energy"
414414
gridImport = "Grid use"
415415
homePower = "Consumption"
416416
loadpoints = "Charger| Charger | {count} chargers"

i18n/es.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ batteryCharge = "Cargar la batería"
428428
batteryDischarge = "Descargar la batería"
429429
batteryHold = "Batería (bloqueada)"
430430
batteryTooltip = "{energy} de {total} ({soc})"
431-
cheapBatteryGridCharge = "Energía de red barata"
432-
cleanBatteryGridCharge = "Energía de red limpia"
433431
gridImport = "Consumo de red"
434432
homePower = "Consumo"
435433
loadpoints = "Punto de carga | Punto de carga | {count} Puntos de carga"

i18n/fi.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ batteryCharge = "Akunlataus"
419419
batteryDischarge = "Akku purkautuu"
420420
batteryHold = "Akku (lukittu)"
421421
batteryTooltip = "{energy} / {total} ({soc})"
422-
cheapBatteryGridCharge = "halpaa energiaa verkosta"
423-
cleanBatteryGridCharge = "puhdasta energiaa verkosta"
424422
gridImport = "Kulutus sähköverkosta"
425423
homePower = "Kodin sähkönkulutus"
426424
loadpoints = "Latauslaite| Latauslaite | {count} latauslaitetta"

i18n/fr.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,6 @@ batteryCharge = "Batterie en charge"
428428
batteryDischarge = "Décharge de la batterie"
429429
batteryHold = "Batterie (verrouillée)"
430430
batteryTooltip = "{energy} sur {total} ({soc})"
431-
cheapBatteryGridCharge = "énergie réseau bon marché"
432-
cleanBatteryGridCharge = "énergie réseau verte"
433431
gridImport = "Utilisation du réseau"
434432
homePower = "Consommation"
435433
loadpoints = "Recharge| Recharge | {count} chargeurs"

i18n/hr.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ batteryCharge = "Punjenje baterije"
420420
batteryDischarge = "Pražnjenje baterije"
421421
batteryHold = "Baterija (zaključano)"
422422
batteryTooltip = "{energy} od {total} ({soc})"
423-
cheapBatteryGridCharge = "jeftina energije iz mreže"
424-
cleanBatteryGridCharge = "čista energija iz mreže"
425423
gridImport = "Upotreba mreže"
426424
homePower = "Potrošnja"
427425
loadpoints = "Punjač| Punjač | {count} punjača"

0 commit comments

Comments
 (0)