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