feat(ladestation): Phasenerkennung und Schaltsperren erweitern
Tests / test (push) Successful in 45s
Tests / test (push) Successful in 45s
This commit is contained in:
@@ -22,17 +22,49 @@ final class LadestationReglerTest extends TestCase
|
||||
self::assertSame(LadestationRegler::PHASEN_DREI, $status['Phasenzahl']);
|
||||
}
|
||||
|
||||
public function testEinphasigesFahrzeugWirdUnterhalb7500WErkannt(): void
|
||||
public function testDirektGemeldeteEinphasigkeitWirdAuchUnter7500WErkannt(): void
|
||||
{
|
||||
$status = LadestationRegler::normalisiereStatus([
|
||||
'Rohstatus' => 2,
|
||||
'Istleistung_W' => 2300.0,
|
||||
'Phasenzahl' => 1,
|
||||
], false);
|
||||
|
||||
self::assertSame(LadestationRegler::PHASEN_EIN, $status['Phasenzahl']);
|
||||
self::assertEqualsWithDelta(10.0, $status['Ladestrom_A'], 0.01);
|
||||
}
|
||||
|
||||
public function testErkannteDreiphasigkeitBleibtWaehrendLadepauseErhalten(): void
|
||||
{
|
||||
$status = LadestationRegler::normalisiereStatus([
|
||||
'Rohstatus' => 2,
|
||||
'Istleistung_W' => 0.0,
|
||||
], true, false, false, true, LadestationRegler::PHASEN_DREI);
|
||||
|
||||
self::assertSame(LadestationRegler::PHASEN_DREI, $status['Phasenzahl']);
|
||||
self::assertSame(0.0, $status['Ladestrom_A']);
|
||||
}
|
||||
|
||||
public function testPhasenBleibenOhneMessungBisZurErkennungUnbekannt(): void
|
||||
{
|
||||
$status = LadestationRegler::normalisiereStatus([
|
||||
'Rohstatus' => 2,
|
||||
'Istleistung_W' => 0.0,
|
||||
], false);
|
||||
|
||||
self::assertSame(LadestationRegler::PHASEN_UNBEKANNT, $status['Phasenzahl']);
|
||||
self::assertSame([0], LadestationRegler::leistungsangebot(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
LadestationRegler::PHASEN_UNBEKANNT,
|
||||
16,
|
||||
true,
|
||||
false
|
||||
));
|
||||
}
|
||||
|
||||
public function testAnlaufOhneGemesseneLadeleistungGiltNichtAlsLadeende(): void
|
||||
{
|
||||
$status = LadestationRegler::normalisiereStatus([
|
||||
@@ -90,7 +122,7 @@ final class LadestationReglerTest extends TestCase
|
||||
|
||||
public function testFahrzeugMaximalstromWirdMitZweiAmpereAbstandErkannt(): void
|
||||
{
|
||||
self::assertSame(16, LadestationRegler::ermittleFahrzeugMaximalstrom(20, 15.9, 20));
|
||||
self::assertSame(18, LadestationRegler::ermittleFahrzeugMaximalstrom(20, 15.9, 20));
|
||||
self::assertNull(LadestationRegler::ermittleFahrzeugMaximalstrom(17, 15.9, 20));
|
||||
self::assertNull(LadestationRegler::ermittleFahrzeugMaximalstrom(20, 0.0, 20));
|
||||
}
|
||||
@@ -104,7 +136,7 @@ final class LadestationReglerTest extends TestCase
|
||||
|
||||
self::assertSame(0, $solarPV[0]);
|
||||
self::assertCount(12, $solarPV);
|
||||
self::assertSame([3850], $normalPV);
|
||||
self::assertSame([3680], $normalPV);
|
||||
self::assertSame([0], $solarPeak);
|
||||
self::assertSame($solarPV, $normalPeak);
|
||||
}
|
||||
@@ -112,7 +144,7 @@ final class LadestationReglerTest extends TestCase
|
||||
public function testPeakKannJedesFahrzeugAufNullSetzen(): void
|
||||
{
|
||||
self::assertSame(0, LadestationRegler::stromFuerLeistung(0, 3));
|
||||
self::assertSame(6, LadestationRegler::stromFuerLeistung(4150, 3));
|
||||
self::assertSame(16, LadestationRegler::stromFuerLeistung(11000, 3));
|
||||
self::assertSame(6, LadestationRegler::stromFuerLeistung(4104, 3));
|
||||
self::assertSame(16, LadestationRegler::stromFuerLeistung(10944, 3));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user