Two tiles named for what they were, not for what they show

The control card's first two tiles were named when OCPP was the only
thing they read. "Connector" is what an OCPP connector state is, and
"Energy" is what a meter total is. Both tiles learned to read the
charger's own snapshot instead — statusDesc and the session's own energy
— and neither name followed.

They take the readings card's names now, and only where they are showing
the readings card's values: the same statusDesc it calls Charging status,
the same session energy it calls Session energy. One value, one name, in
both places it appears. OCPP keeps the old two, which are right for what
it puts there.

Both strings were already translated, so this adds none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-09-03 20:21:28 +02:00
co-authored by Claude Opus 5
parent 7b339d3dac
commit c65ce0c081
+19 -2
View File
@@ -337,6 +337,23 @@ const ctlStatusLabel = computed(() => {
return (ctlReadsDevice.value ? s.statusDesc : s.connectorStatus) || "—";
});
// And named for whichever of the two it is showing. The tile was called
// "Connector" from when OCPP was the only thing it read: an OCPP connector state
// is what that word means. Reading the charger's own snapshot it holds the
// charger's own status — the same statusDesc the readings card shows as
// "Charging status", so it takes that card's name for it rather than a second
// name for one value.
const ctlStatusTitle = computed(() =>
ctlReadsDevice.value ? t("charging.modbus.chargingStatus") : t("charging.control.status")
);
// The energy tile has the same two readings and the same problem: "Energy" is
// what an OCPP meter total is, and the charger's own snapshot counts this
// session's energy instead. Named from the same card as the status above it.
const ctlMeterTitle = computed(() =>
ctlReadsDevice.value ? t("charging.modbus.sessionEnergy") : t("charging.control.meter")
);
// --- The charger's own snapshot, grouped for reading ---
//
// Reading the charger directly reports far more than OCPP does: one poll carries
@@ -2031,11 +2048,11 @@ onMounted(async () => {
<div class="mt-3 grid grid-cols-2 gap-2">
<div class="rounded-control bg-sunken px-3 py-2">
<div class="data text-sm font-semibold text-strong">{{ ctlStatusLabel }}</div>
<div class="text-[11px] text-muted">{{ t("charging.control.status") }}</div>
<div class="text-[11px] text-muted">{{ ctlStatusTitle }}</div>
</div>
<div class="rounded-control bg-sunken px-3 py-2">
<div class="data text-sm font-semibold text-strong">{{ ctlMeterKwh }} kWh</div>
<div class="text-[11px] text-muted">{{ t("charging.control.meter") }}</div>
<div class="text-[11px] text-muted">{{ ctlMeterTitle }}</div>
</div>
<div v-if="ctlPower" class="rounded-control bg-sunken px-3 py-2">
<div class="data text-sm font-semibold text-strong">{{ ctlPower }}</div>