This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user