diff --git a/src/pluginbattery/static/app.js b/src/pluginbattery/static/app.js index d9e77fa..0051eb1 100644 --- a/src/pluginbattery/static/app.js +++ b/src/pluginbattery/static/app.js @@ -97,13 +97,8 @@ function renderBest(b) { dt("Payback"), dd(`${fmtPayback(b.lp_payback)} years`), dt("10-yr net profit"), dd(`€${fmtNum(b.ten_year_profit_eur, 0)}`), dt("Battery"), dd(`${fmtNum(b.capacity_kwh)} kWh / ${fmtNum(b.power_kw, 1)} kW · €${fmtNum(b.price_eur, 0)}`), + dt("Solar surplus captured"), dd(`${fmtNum(b.captured_kwh, 0)} kWh (${fmtNum(b.captured_pct, 0)}% of total)`), ); - if (b.store_year1 != null) { - dl.append( - dt("Store quote"), - dd(`€${fmtNum(b.store_year1, 0)}/yr (${fmtPayback(b.store_payback)} yr) — overstates by ${fmtNum(b.overstatement)}×`), - ); - } bestEl.appendChild(dl); } @@ -131,9 +126,10 @@ function renderTable(rows) { td(`€${fmtNum(r.lp_year1, 0)}`), td(fmtPayback(r.lp_payback)), td(`€${fmtNum(r.ten_year_profit_eur, 0)}`, { className: tenYrCls }), - td(r.store_year1 == null ? "—" : `€${fmtNum(r.store_year1, 0)}`), - td(fmtPayback(r.store_payback)), - td(r.overstatement == null ? "—" : `${fmtNum(r.overstatement)}×`), + td(fmtNum(r.captured_kwh, 0)), + td(`${fmtNum(r.captured_pct, 0)}%`), + td(`${fmtNum(r.pct_hours_battery_full, 0)}%`), + td(`${fmtNum(r.pct_hours_charge_saturated, 0)}%`), ); tbody.appendChild(tr); }); @@ -219,7 +215,6 @@ function captureInitialFromDOM() { lastBatteries = rows.map((tr) => { const cells = tr.children; const link = cells[1].querySelector("a"); - const storeText = cells[8].textContent.trim(); return { category: tr.dataset.category || null, title: (link ? link.textContent : cells[1].textContent).trim(), @@ -230,9 +225,10 @@ function captureInitialFromDOM() { lp_year1: parseFloat(cells[5].textContent.replace("€", "")), lp_payback: cells[6].textContent.trim() === "—" ? null : parseFloat(cells[6].textContent), ten_year_profit_eur: parseFloat(cells[7].textContent.replace("€", "")), - store_year1: storeText === "—" ? null : parseFloat(storeText.replace("€", "")), - store_payback: cells[9].textContent.trim() === "—" ? null : parseFloat(cells[9].textContent), - overstatement: cells[10].textContent.trim() === "—" ? null : parseFloat(cells[10].textContent), + captured_kwh: parseFloat(cells[8].textContent), + captured_pct: parseFloat(cells[9].textContent), + pct_hours_battery_full: parseFloat(cells[10].textContent), + pct_hours_charge_saturated: parseFloat(cells[11].textContent), }; }); } diff --git a/src/pluginbattery/templates/index.html b/src/pluginbattery/templates/index.html index ab815ce..2f42eb0 100644 --- a/src/pluginbattery/templates/index.html +++ b/src/pluginbattery/templates/index.html @@ -4,7 +4,7 @@