diff --git a/LadestationStandAlone/module.php b/LadestationStandAlone/module.php index 2b182c2..de4abeb 100644 --- a/LadestationStandAlone/module.php +++ b/LadestationStandAlone/module.php @@ -117,6 +117,10 @@ class LadestationStandAlone extends IPSModule implements VerbraucherSchnittstell $this->initialisiereLokaleEinstellungen(); $this->aktualisiereVariablen(); + // Ein persistiertes Ladeende nach Neueinrichtung oder Modulupdate einmal neu pruefen. + $this->setzeZustand('FahrzeugGeladen', false); + $this->WriteAttributeInteger('LetzterGesetzterStrom', -1); + try { $this->pruefeKonfiguration(); } catch (Throwable $fehler) { diff --git a/tests/Symcon/modules/LadestationStandAlone.php b/tests/Symcon/modules/LadestationStandAlone.php index 9e84535..c5aed63 100644 --- a/tests/Symcon/modules/LadestationStandAlone.php +++ b/tests/Symcon/modules/LadestationStandAlone.php @@ -151,6 +151,29 @@ return static function (TestContext $test): void { ); }); + $test->runCase('ApplyChanges prueft ein gespeichertes Ladeende neu', static function ( + TestContext $test + ) use ($goEAntwort, $solarPause): void { + IPS_RequestAction($solarPause, 'Solarladen', false); + IPS_RequestAction($solarPause, 'Statuszyklus', false); + $test->assertSame( + true, + GetValue($test->objectByIdent('FahrzeugGeladen', $solarPause)) + ); + + IPS_SetProperty($solarPause, 'Testantwort', $goEAntwort(2, 2300)); + IPS_ApplyChanges($solarPause); + + $test->assertSame( + false, + GetValue($test->objectByIdent('FahrzeugGeladen', $solarPause)) + ); + $test->assertSame( + 3, + GetValue($test->objectByIdent('Fahrzeugstatus', $solarPause)) + ); + }); + $test->runCase('Solar- und Peakbetrieb liefern die Enelix-1-Angebote', static function ( TestContext $test ) use ($stationen, $anforderungSenden): void {