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:
@@ -1,5 +1,5 @@
|
|||||||
name: ShineBridge
|
name: ShineBridge
|
||||||
version: "1.6.3"
|
version: "1.6.4"
|
||||||
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
|
||||||
|
|||||||
@@ -450,20 +450,19 @@ function renderEnergy(inverters, aggregates) {
|
|||||||
// Path segments (bezier from node-edge to node-edge)
|
// Path segments (bezier from node-edge to node-edge)
|
||||||
// Solar(145,75) bottom→ House(260,180) top; Grid(375,75) bottom→ House top
|
// 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
|
// House bottom → Battery(145,292) top; House bottom → EV(375,292) top
|
||||||
|
// Alle 5 Nodes immer anzeigen — Batterie nur gedimmt wenn inaktiv
|
||||||
const SEG = [
|
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-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,119 C 375,155 260,155 260,136`, col:impOn?C.imp:C.exp, on:impOn||expOn, rev:expOn },
|
{ 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 245,224 C 215,260 145,260 145,248`, col:C.bat, on:hasBat&&(chOn||dchOn), rev:dchOn },
|
{ 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 275,224 C 305,260 375,260 375,248`, col:C.ev, on:evOn, rev:false },
|
{ 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 = SEG.map(s => `<path id="${s.id}" d="${s.d}" fill="none"/>`).join('');
|
||||||
|
const lines = SEG.map(s =>
|
||||||
const defs = activeSeg.map(s => `<path id="${s.id}" d="${s.d}" fill="none"/>`).join('');
|
`<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"'}/>`
|
||||||
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"'}/>`
|
|
||||||
).join('');
|
).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 gridCol = impOn ? C.imp : expOn ? C.exp : C.dim;
|
||||||
const gridLbl = impOn ? 'NETZBEZUG' : expOn ? 'EINSPEISUNG' : 'NETZ';
|
const gridLbl = impOn ? 'NETZBEZUG' : expOn ? 'EINSPEISUNG' : 'NETZ';
|
||||||
@@ -472,15 +471,15 @@ function renderEnergy(inverters, aggregates) {
|
|||||||
const batLbl = chOn ? 'LADEN' : dchOn ? 'ENTLADEN' : 'BATTERIE';
|
const batLbl = chOn ? 'LADEN' : dchOn ? 'ENTLADEN' : 'BATTERIE';
|
||||||
const batSub = batSoc != null ? Math.round(batSoc) + '%' : '';
|
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>
|
<defs>${defs}</defs>
|
||||||
${lines}
|
${lines}
|
||||||
${dotsSvg}
|
${dotsSvg}
|
||||||
${node(145, 75, 'solar', 'SOLAR', pvW, C.pv, pvOn, '')}
|
${node(145, 84, 'solar', 'SOLAR', pvW, C.pv, pvOn, '')}
|
||||||
${node(375, 75, 'grid', gridLbl, gridVal, gridCol, impOn||expOn, '')}
|
${node(375, 84, 'grid', gridLbl, gridVal, gridCol, impOn||expOn, '')}
|
||||||
${node(260, 180, 'house', 'HAUS', houseW, C.txt, true, '')}
|
${node(260, 202, 'house', 'HAUS', houseW, C.txt, true, '')}
|
||||||
${hasBat ? node(145, 292, 'bat', batLbl, batVal, C.bat, chOn||dchOn, batSub) : ''}
|
${node(145, 320, 'bat', batLbl, batVal, C.bat, chOn||dchOn, batSub)}
|
||||||
${node(375, 292, 'ev', 'WALLBOX', evW, C.ev, evOn, '')}
|
${node(375, 320, 'ev', 'WALLBOX', evW, C.ev, evOn, '')}
|
||||||
</svg>`;
|
</svg>`;
|
||||||
|
|
||||||
function kwhCard(label, val, col) {
|
function kwhCard(label, val, col) {
|
||||||
|
|||||||
Reference in New Issue
Block a user