Fix: Alle 5 Nodes immer sichtbar, mehr vertikaler Abstand (v1.6.4)

- Batterie-Node immer gerendert (nicht mehr hasBat-conditional)
- Vertikaler Abstand erhöht: Solar/Grid y=84, Haus y=202, Bat/EV y=320
- ViewBox 520×400 statt 520×360
- Bezier-Pfade an neue Positionen angepasst

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
retr0
2026-04-28 22:24:41 +02:00
parent f37efb6ad1
commit 9eef66812b
2 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: ShineBridge
version: "1.6.3"
version: "1.6.4"
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
+15 -16
View File
@@ -450,20 +450,19 @@ 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
// Alle 5 Nodes immer anzeigen — Batterie nur gedimmt wenn inaktiv
const SEG = [
{ id:'ep-pv', d:`M 145,119 C 145,155 260,155 260,136`, col:C.pv, on:pvOn, rev:false },
{ id:'ep-grid', d:`M 375,119 C 375,155 260,155 260,136`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn },
{ id:'ep-bat', d:`M 245,224 C 215,260 145,260 145,248`, col:C.bat, on:hasBat&&(chOn||dchOn), rev:dchOn },
{ id:'ep-ev', d:`M 275,224 C 305,260 375,260 375,248`, col:C.ev, on:evOn, rev:false },
{ id:'ep-pv', d:`M 145,128 C 145,172 260,172 260,158`, col:C.pv, on:pvOn, rev:false },
{ id:'ep-grid', d:`M 375,128 C 375,172 260,172 260,158`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn },
{ id:'ep-bat', d:`M 247,246 C 213,282 145,282 145,276`, col:C.bat, on:chOn||dchOn, rev:dchOn },
{ id:'ep-ev', d:`M 273,246 C 307,282 375,282 375,276`, col:C.ev, on:evOn, rev:false },
];
const activeSeg = SEG.filter(s => hasBat || s.id !== 'ep-bat');
const defs = activeSeg.map(s => `<path id="${s.id}" d="${s.d}" fill="none"/>`).join('');
const lines = activeSeg.map(s =>
`<use href="#${s.id}" fill="none" stroke="${s.on?s.col:C.brd}" stroke-width="${s.on?2.5:1.5}" stroke-linecap="round" ${s.on?'':'opacity=".35"'}/>`
const defs = SEG.map(s => `<path id="${s.id}" d="${s.d}" fill="none"/>`).join('');
const lines = SEG.map(s =>
`<use href="#${s.id}" fill="none" stroke="${s.on?s.col:C.brd}" stroke-width="${s.on?2.5:1.5}" stroke-linecap="round" ${s.on?'':'opacity=".3"'}/>`
).join('');
const dotsSvg = activeSeg.map(s => flowDots(s.id, s.col, s.on, s.rev)).join('');
const dotsSvg = SEG.map(s => flowDots(s.id, s.col, s.on, s.rev)).join('');
const gridCol = impOn ? C.imp : expOn ? C.exp : C.dim;
const gridLbl = impOn ? 'NETZBEZUG' : expOn ? 'EINSPEISUNG' : 'NETZ';
@@ -472,15 +471,15 @@ function renderEnergy(inverters, aggregates) {
const batLbl = chOn ? 'LADEN' : dchOn ? 'ENTLADEN' : 'BATTERIE';
const batSub = batSoc != null ? Math.round(batSoc) + '%' : '';
const svg = `<svg viewBox="0 0 520 360" width="100%" style="display:block;padding:20px 10px" xmlns="http://www.w3.org/2000/svg">
const svg = `<svg viewBox="0 0 520 400" width="100%" style="display:block" xmlns="http://www.w3.org/2000/svg">
<defs>${defs}</defs>
${lines}
${dotsSvg}
${node(145, 75, 'solar', 'SOLAR', pvW, C.pv, pvOn, '')}
${node(375, 75, 'grid', gridLbl, gridVal, gridCol, impOn||expOn, '')}
${node(260, 180, 'house', 'HAUS', houseW, C.txt, true, '')}
${hasBat ? node(145, 292, 'bat', batLbl, batVal, C.bat, chOn||dchOn, batSub) : ''}
${node(375, 292, 'ev', 'WALLBOX', evW, C.ev, evOn, '')}
${node(145, 84, 'solar', 'SOLAR', pvW, C.pv, pvOn, '')}
${node(375, 84, 'grid', gridLbl, gridVal, gridCol, impOn||expOn, '')}
${node(260, 202, 'house', 'HAUS', houseW, C.txt, true, '')}
${node(145, 320, 'bat', batLbl, batVal, C.bat, chOn||dchOn, batSub)}
${node(375, 320, 'ev', 'WALLBOX', evW, C.ev, evOn, '')}
</svg>`;
function kwhCard(label, val, col) {