fix(ladestation): Regeluebergaenge stabilisieren
Tests / test (push) Successful in 50s

This commit is contained in:
dh
2026-10-01 13:01:32 +00:00
parent 8357e8dfab
commit 3ce9af4244
11 changed files with 427 additions and 119 deletions
+16
View File
@@ -15,6 +15,22 @@ final class LadestationRegler
private const LEISTUNG_PRO_AMPERE_EINPHASIG = 230;
private const LEISTUNG_PRO_AMPERE_DREIPHASIG = 684;
public static function erkennePhasenzahlAusLeistung(
float $leistung,
int $angeforderterStrom
): int {
if (!is_finite($leistung) || $leistung < 0.0) {
throw new InvalidArgumentException('Istleistung muss endlich und darf nicht negativ sein.');
}
if ($angeforderterStrom < 6 || $angeforderterStrom > 32) {
throw new InvalidArgumentException('Erkennungsstrom muss zwischen 6 und 32 A liegen.');
}
$trennleistung = 2 * self::LEISTUNG_PRO_AMPERE_EINPHASIG * $angeforderterStrom;
return $leistung > $trennleistung ? self::PHASEN_DREI : self::PHASEN_EIN;
}
/**
* Die Schwelle und der Zuschlag von 2.5 A stammen aus der Enelix-1-Ladestation.
* Ein Ladeende wird erst nach zuvor gemessener Ladeleistung angenommen, damit