diff --git a/assets/js/components/Forecast/Details.vue b/assets/js/components/Forecast/Details.vue index b42500dcf..f0aadb229 100644 --- a/assets/js/components/Forecast/Details.vue +++ b/assets/js/components/Forecast/Details.vue @@ -36,6 +36,14 @@ +
+
+
{{ label("constant") }}
+
+ {{ constantValue }} +
+
+
{{ label("range") }}
@@ -118,6 +126,17 @@ export default defineComponent({ .filter((slot) => new Date(slot.end) > now) .slice(0, FORECASTED_HOURS * SLOTS_PER_HOUR); }, + isConstantValue(): boolean { + if (this.isSolar) return false; + const slots = this.upcomingSlots; + if (slots.length === 0) return false; + + const firstValue = slots[0]?.value; + return slots.every((slot) => slot.value === firstValue); + }, + constantValue(): string { + return this.fmtValue(this.upcomingSlots[0]!.value, true); + }, averagePrice() { if (this.isSolar) return ""; const slots = this.upcomingSlots; diff --git a/i18n/de.json b/i18n/de.json index 702976c9c..1114c2959 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -756,12 +756,14 @@ "forecast": { "co2": { "average": "Durchschnitt", + "constant": "CO₂-Intensität", "lowestHour": "Sauberste Stunde", "range": "Bereich" }, "modalTitle": "Vorhersage", "price": { "average": "Durchschnitt", + "constant": "Preis", "lowestHour": "Günstigste Stunde", "range": "Bereich" }, diff --git a/i18n/en.json b/i18n/en.json index 92ff001be..425f9b05a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -756,12 +756,14 @@ "forecast": { "co2": { "average": "Average", + "constant": "CO₂ intensity", "lowestHour": "Cleanest hour", "range": "Range" }, "modalTitle": "Forecast", "price": { "average": "Average", + "constant": "Price", "lowestHour": "Cheapest hour", "range": "Range" },