From e0814a0c1430702312117795434a726aa4e05cc2 Mon Sep 17 00:00:00 2001 From: dh_Agent Date: Tue, 29 Sep 2026 09:19:39 +0000 Subject: [PATCH] =?UTF-8?q?fix(ladestation):=20Ladeende=20nach=20Update=20?= =?UTF-8?q?neu=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LadestationStandAlone/module.php | 4 ++++ .../Symcon/modules/LadestationStandAlone.php | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+) 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 {