Skip to content

Commit 7158431

Browse files
committed
fix: split grid import/export into two lines
The grid section showed "Importing 1500 W" on one line. Split it so the direction (Importing/Exporting/Idle) is on the first line and the wattage is on the second line.
1 parent 0e2d019 commit 7158431

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎api/static/index.html‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<div class="label" id="grid-label">Grid</div>
171171
<div class="property" id="sa-grid-v">--</div>
172172
<div class="property font-small" id="sa-grid-prop">--</div>
173+
<div class="property font-small" id="sa-grid-watts">--</div>
173174
</div>
174175
</a></div>
175176
<div><a href="#" class="status" data-detail="battery" aria-labelledby="battery-label">
@@ -539,7 +540,16 @@ <h3>Timer Schedule</h3>
539540
const gridIn = val(r,'grid_import_power') || 0;
540541
const gridOut = val(r,'grid_export_power') || 0;
541542
setText('sa-grid-v', gridV !== undefined ? fmt(gridV) + ' V' : null);
542-
setText('sa-grid-prop', gridIn > 0 ? 'Importing ' + fmtInt(gridIn) + ' W' : (gridOut > 0 ? 'Exporting ' + fmtInt(gridOut) + ' W' : 'Idle'));
543+
if (gridIn > 0) {
544+
setText('sa-grid-prop', 'Importing');
545+
setText('sa-grid-watts', fmtInt(gridIn) + ' W');
546+
} else if (gridOut > 0) {
547+
setText('sa-grid-prop', 'Exporting');
548+
setText('sa-grid-watts', fmtInt(gridOut) + ' W');
549+
} else {
550+
setText('sa-grid-prop', 'Idle');
551+
setText('sa-grid-watts', '--');
552+
}
543553

544554
const batV = val(r,'battery_voltage');
545555
const soc = val(r,'soc');

0 commit comments

Comments
 (0)