Feature: Wallbox-Node nur wenn KATHREIN_WALLBOX konfiguriert (v1.6.6)

- hasEV-Flag aus invertersList: nur KATHREIN_WALLBOX zeigt EV-Node
- Ohne Wallbox: flacheres Layout (viewBox 520x278 statt 410)
- SEG-Array und SVG-Node konditionell

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
retr0
2026-04-28 22:31:06 +02:00
parent 220a16c13d
commit 5972ef2c35
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: ShineBridge
version: "1.6.5"
version: "1.6.6"
slug: shinebridge
description: Growatt Wechselrichter lokal in Home Assistant — Modbus TCP via ShineLAN-X, MQTT Discovery, Web UI
url: https://gitea.bitfire.work/retr0/shinebridge
+6 -5
View File
@@ -378,6 +378,7 @@ function renderEnergy(inverters, aggregates) {
const gridExport = Math.max(0, -gridW);
const houseW = Math.max(0, pvW + gridImport + batDchW - batChW - evW);
const hasBat = Object.keys(aggregates).some(k => k.startsWith('bat_'));
const hasEV = invertersList.some(c => c.inverter_model === 'KATHREIN_WALLBOX');
const T = 20;
const pvOn = pvW > T;
@@ -450,12 +451,12 @@ function renderEnergy(inverters, aggregates) {
// Path segments (bezier from node-edge to node-edge)
// Solar(145,75) bottom→ House(260,180) top; Grid(375,75) bottom→ House top
// House bottom → Battery(145,292) top; House bottom → EV(375,292) top
// Kreuz-Layout: Solar oben, Grid links, Haus Mitte, Batterie rechts, Wallbox unten
// Kreuz-Layout: Solar oben, Grid links, Haus Mitte, Batterie rechts, Wallbox unten (optional)
const SEG = [
{ id:'ep-pv', d:`M 260,121 C 258,138 262,146 260,158`, col:C.pv, on:pvOn, rev:false },
{ id:'ep-grid', d:`M 140,200 C 162,197 192,203 214,200`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn },
{ id:'ep-bat', d:`M 306,200 C 330,197 356,203 380,200`, col:C.bat, on:chOn||dchOn, rev:dchOn },
{ id:'ep-ev', d:`M 260,244 C 258,261 262,269 260,279`, col:C.ev, on:evOn, rev:false },
...(hasEV ? [{ id:'ep-ev', d:`M 260,244 C 258,261 262,269 260,279`, col:C.ev, on:evOn, rev:false }] : []),
];
const defs = SEG.map(s => `<path id="${s.id}" d="${s.d}" fill="none"/>`).join('');
@@ -471,8 +472,8 @@ function renderEnergy(inverters, aggregates) {
const batLbl = chOn ? 'LADEN' : dchOn ? 'ENTLADEN' : 'BATTERIE';
const batSub = batSoc != null ? Math.round(batSoc) + '%' : '';
// ViewBox: Grid-left=51, Bat-right=469, Solar-top=33, EV-bottom=367 → 520×410
const svg = `<svg viewBox="0 0 520 410" width="100%" style="display:block" xmlns="http://www.w3.org/2000/svg">
const svgH = hasEV ? 410 : 278;
const svg = `<svg viewBox="0 0 520 ${svgH}" width="100%" style="display:block" xmlns="http://www.w3.org/2000/svg">
<defs>${defs}</defs>
${lines}
${dotsSvg}
@@ -480,7 +481,7 @@ function renderEnergy(inverters, aggregates) {
${node( 95, 200, 'grid', gridLbl, gridVal, gridCol, impOn||expOn, '')}
${node(260, 200, 'house', 'HAUS', houseW, C.txt, true, '')}
${node(425, 200, 'bat', batLbl, batVal, C.bat, chOn||dchOn, batSub)}
${node(260, 323, 'ev', 'WALLBOX', evW, C.ev, evOn, '')}
${hasEV ? node(260, 323, 'ev', 'WALLBOX', evW, C.ev, evOn, '') : ''}
</svg>`;
function kwhCard(label, val, col) {