diff --git a/frontend/src/components/WaterSoftenerDiagram.tsx b/frontend/src/components/WaterSoftenerDiagram.tsx index edc79da..4531c67 100644 --- a/frontend/src/components/WaterSoftenerDiagram.tsx +++ b/frontend/src/components/WaterSoftenerDiagram.tsx @@ -89,6 +89,23 @@ export default function WaterSoftenerDiagram({ asset }: { asset: AssetStatus }) const bPct = bValL !== null && cfg.tank_b_max_l ? (bValL / cfg.tank_b_max_l) * 100 : null const brinePct = numericValue(brineField) + // On an alternating twin-tank softener, service switches to the other tank + // the moment one depletes, and the just-depleted tank regenerates offline — + // so the regenerating tank is whichever one is NOT tank_in_service. A single + // tank has no partner to switch to, so it simply tracks regen_active. + const aRegenerating = single ? regenActive : regenActive && bInService + const bRegenerating = regenActive && !bInService + + function Flow({ active }: { active: boolean }) { + return ( + + ) + } + return (
{regenActive && ( @@ -105,26 +122,25 @@ export default function WaterSoftenerDiagram({ asset }: { asset: AssetStatus }) variant="single" regenerating={false} /> - + {!single && ( - + <> + + + )}