Fix: Finanzen-Tab bleibt bei 'Lade...' hängen (v1.8.21)
fEur/fKwh waren lokale Funktionen in renderEnergy() — loadFinance() konnte sie nicht aufrufen (ReferenceError außerhalb des Scopes). Beide Funktionen in den globalen Scope verschoben, lokale Kopien entfernt. loadFinance() Rendering-Block in try/catch gewrappt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,3 +94,5 @@
|
|||||||
| v1.8.17 | 2026-05-04 | Fix: Atomarer Config-Write + Backup-Fallback |
|
| v1.8.17 | 2026-05-04 | Fix: Atomarer Config-Write + Backup-Fallback |
|
||||||
| v1.8.18 | 2026-05-05 | Feature: Flash-Wizard, Setup-Wizard, NuttX OTA, MQTT rc=5, Port-Sicherheit |
|
| v1.8.18 | 2026-05-05 | Feature: Flash-Wizard, Setup-Wizard, NuttX OTA, MQTT rc=5, Port-Sicherheit |
|
||||||
| v1.8.19 | 2026-05-05 | Fix: Mobile-Layout — Tabs scrollen, kein horizontaler Overflow |
|
| v1.8.19 | 2026-05-05 | Fix: Mobile-Layout — Tabs scrollen, kein horizontaler Overflow |
|
||||||
|
| v1.8.20 | 2026-05-05 | Fix: Eigenversorgungskarte bei PV offline, Stromtarif-Einstellungen gehen nicht verloren |
|
||||||
|
| v1.8.21 | 2026-05-05 | Fix: Finanzen-Tab bleibt nicht bei "Lade..." hängen (fEur/fKwh Scope-Bug) |
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: ShineBridge
|
name: ShineBridge
|
||||||
version: "1.8.20"
|
version: "1.8.21"
|
||||||
slug: shinebridge
|
slug: shinebridge
|
||||||
description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI
|
description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI
|
||||||
url: https://gitea.bitfire.work/retr0/shinebridge
|
url: https://gitea.bitfire.work/retr0/shinebridge
|
||||||
|
|||||||
@@ -713,6 +713,15 @@ function renderSpotChart(spotData) {
|
|||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function fEur(v) {
|
||||||
|
if (v == null) return null;
|
||||||
|
return v >= 100 ? v.toFixed(0) + ' €' : v.toFixed(2) + ' €';
|
||||||
|
}
|
||||||
|
function fKwh(v) {
|
||||||
|
if (v == null) return null;
|
||||||
|
return (v >= 100 ? v.toFixed(0) : v.toFixed(1)) + ' kWh';
|
||||||
|
}
|
||||||
|
|
||||||
function renderEnergy(inverters, aggregates, period, spotData) {
|
function renderEnergy(inverters, aggregates, period, spotData) {
|
||||||
const el = document.getElementById("energy-content");
|
const el = document.getElementById("energy-content");
|
||||||
if (!aggregates || !Object.keys(aggregates).length) {
|
if (!aggregates || !Object.keys(aggregates).length) {
|
||||||
@@ -848,15 +857,6 @@ function renderEnergy(inverters, aggregates, period, spotData) {
|
|||||||
const pi = period.price_import || 0.30;
|
const pi = period.price_import || 0.30;
|
||||||
const pe = period.price_export || 0.08;
|
const pe = period.price_export || 0.08;
|
||||||
|
|
||||||
function fEur(v) {
|
|
||||||
if (v == null) return null;
|
|
||||||
return v >= 100 ? v.toFixed(0) + ' €' : v.toFixed(2) + ' €';
|
|
||||||
}
|
|
||||||
function fKwh(v) {
|
|
||||||
if (v == null) return null;
|
|
||||||
return (v >= 100 ? v.toFixed(0) : v.toFixed(1)) + ' kWh';
|
|
||||||
}
|
|
||||||
|
|
||||||
function periodCard(label, kwh, cost, col, sub) {
|
function periodCard(label, kwh, cost, col, sub) {
|
||||||
if (kwh == null) return '';
|
if (kwh == null) return '';
|
||||||
return `<div class="kwh-card" style="border-top:3px solid ${col}">
|
return `<div class="kwh-card" style="border-top:3px solid ${col}">
|
||||||
@@ -937,6 +937,7 @@ async function loadFinance() {
|
|||||||
try { data = await fetchJSON(api("api/finance")); }
|
try { data = await fetchJSON(api("api/finance")); }
|
||||||
catch(e) { el.innerHTML = '<div class="no-data">Fehler beim Laden</div>'; return; }
|
catch(e) { el.innerHTML = '<div class="no-data">Fehler beim Laden</div>'; return; }
|
||||||
|
|
||||||
|
try {
|
||||||
const { days, fixed_total_eur, spot_total_eur, savings_eur, period_start, spot_days, total_days } = data;
|
const { days, fixed_total_eur, spot_total_eur, savings_eur, period_start, spot_days, total_days } = data;
|
||||||
|
|
||||||
if (!days || days.length === 0) {
|
if (!days || days.length === 0) {
|
||||||
@@ -1033,6 +1034,7 @@ async function loadFinance() {
|
|||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
el.innerHTML = empfehlung + cards + chart;
|
el.innerHTML = empfehlung + cards + chart;
|
||||||
|
} catch(e) { el.innerHTML = '<div class="no-data">Fehler beim Laden</div>'; console.error('loadFinance:', e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Live Data ─────────────────────────────────────────────────
|
// ── Live Data ─────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user