Rename stats to statistics (BC) (#10551)

This commit is contained in:
andig 2023-10-29 12:29:53 +01:00 • committed by GitHub
parent 4bddf556df
commit da68bc03b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 14 deletions

View file

@ -212,7 +212,7 @@ export default {
components: { Sponsor, SavingsTile, LiveCommunity, TelemetrySettings, CustomSelect },
mixins: [formatter],
props: {
stats: { type: Object, default: () => ({}) },
statistics: { type: Object, default: () => ({}) },
co2Configured: Boolean,
sponsor: String,
currency: String,
@ -256,7 +256,7 @@ export default {
},
avgPriceFormatted() {
const value = this.fmtPricePerKWh(
this.currentStats.avgPrice,
this.currentStatistics.avgPrice,
this.currency,
false,
false
@ -264,14 +264,14 @@ export default {
const unit = this.pricePerKWhUnit(this.currency);
return { value, unit };
},
currentStats() {
return this.stats[this.period] || {};
currentStatistics() {
return this.statistics[this.period] || {};
},
totalCharged() {
return this.currentStats.chargedKWh;
return this.currentStatistics.chargedKWh;
},
solarPercentage() {
return this.currentStats.solarPercentage;
return this.currentStatistics.solarPercentage;
},
solarCharged() {
return (this.solarPercentage / 100) * this.totalCharged;
@ -280,10 +280,10 @@ export default {
return this.totalCharged - this.solarCharged;
},
avgPrice() {
return this.currentStats.avgPrice;
return this.currentStatistics.avgPrice;
},
avgCo2() {
return this.currentStats.avgCo2;
return this.currentStatistics.avgCo2;
},
priceConfigured() {
return this.referenceGrid !== undefined;

View file

@ -80,7 +80,7 @@ export default {
auth: Object,
currency: String,
stats: Object,
statistics: Object,
tariffFeedIn: Number,
tariffGrid: Number,
tariffCo2: Number,
@ -136,7 +136,7 @@ export default {
},
sponsor: this.sponsor,
savings: {
stats: this.stats,
statistics: this.statistics,
co2Configured: this.tariffCo2 !== undefined,
priceConfigured: this.tariffGrid !== undefined,
currency: this.currency,

View file

@ -30,12 +30,12 @@ func (s *Stats) Update(p publisher) {
return
}
var stats = map[string]map[string]float64{
stats := map[string]map[string]float64{
"30d": s.calculate(30),
"365d": s.calculate(365),
"total": s.calculate(365 * 100), // 100 years
}
p.publish("stats", stats)
p.publish("statistics", stats)
s.updated = time.Now()
}

View file

@ -19,6 +19,7 @@ var deprecatedTopics = []string{
"activePhases", "range", "socCharge",
"vehicleSoC", "batterySoC", "bufferSoC", "minSoC", "prioritySoC", "targetSoC", "vehicleTargetSoC",
"savingsAmount", "savingsEffectivePrice", "savingsGridCharged", "savingsSelfConsumptionCharged", "savingsSelfConsumptionPercent", "savingsTotalCharged",
"stats/30d", "stats/365d", "stats/total",
}
// MQTT is the MQTT server. It uses the MQTT client for publishing.

View file

@ -2,7 +2,7 @@ const { test, expect } = require("@playwright/test");
const { start, stop } = require("./evcc");
test.beforeAll(async () => {
await start("stats.evcc.yaml", "stats.sql");
await start("statistics.evcc.yaml", "statistics.sql");
});
test.afterAll(async () => {
await stop();
@ -32,7 +32,7 @@ test.describe("footer", async () => {
});
});
test.describe.skip("stats values", async () => {
test.describe.skip("statistics values", async () => {
test("last 30 days", async ({ page }) => {
await page.goto("/");
await page.getByTestId("savings-button").click();