Add explicit "no protection device" state for circuits

Circuits can now record that they deliberately have no protection device
(type NONE, shown as "–"), separate from circuits whose protection is
still open. Migration 0017 makes rated_current_a nullable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian Appel 2026-10-30 13:11:28 +01:00
parent 1f3b903809
commit 38019fe087
27 changed files with 3673 additions and 132 deletions

View file

@ -197,6 +197,18 @@ describe("circuit grid model", () => {
),
"FI/LS · 16 A · B · Typ A · 30 mA"
);
const withoutDevice = {
...circuit,
protectionDevice: { type: "NONE" as const },
};
assert.equal(getCircuitValue(withoutDevice, "protectionSummary"), "–");
assert.equal(getCircuitValue(withoutDevice, "protectionType"), "–");
assert.equal(getCircuitValue(withoutDevice, "protectionRatedCurrent"), undefined);
// A circuit without any protection record is still open.
assert.equal(
getCircuitValue({ ...circuit, protectionDevice: undefined }, "protectionSummary"),
undefined
);
assert.equal(getCircuitValue(circuit, "voltage"), 230);
assert.equal(getCircuitValue(circuit, "controlRequirement"), "DALI");
assert.equal(getCircuitValue(circuit, "cableSummary"), "NYM-J, 1.5 mm², 20 m");