fix default battery limitation for growatt

This commit is contained in:
Yinyin Liu 2026-05-04 18:11:54 +02:00
parent b9745a1712
commit c5678b0856
1 changed files with 6 additions and 4 deletions

View File

@ -225,10 +225,12 @@ function SodistoreHomeConfigurationV2(props: SodistoreHomeConfigurationProps) {
const clKey = `Cluster${clIdx + 1}`;
const filled = (tree[invIdx]?.[clIdx] ?? []).filter((s) => s !== '').length;
const existingCl = existingInv?.Clusters?.[clKey];
// Default current uses the cluster's ideal battery count (slotCount from the
// installation model preset), not the count of filled SNs — so an empty or
// partially-filled cluster still ships a sane non-zero limit.
const defaultCurrent = defaultClusterCurrent(slotCount);
// Default current = (effective battery count) × 95A.
// Partial fill: use the actual installed count (real safety limit).
// Empty cluster (no SNs yet): fall back to the cluster's ideal slot count
// so a freshly-created installation gets a sensible default.
const effectiveCount = filled > 0 ? filled : slotCount;
const defaultCurrent = defaultClusterCurrent(effectiveCount);
cls[clKey] = {
BatteryCount: filled,
MaxChargingCurrent: existingCl?.MaxChargingCurrent ?? defaultCurrent,