From bfdcf4536b2328f53f2b1aa02d3f977dfb13294d Mon Sep 17 00:00:00 2001 From: dh_Agent Date: Wed, 30 Sep 2026 04:37:33 +0000 Subject: [PATCH] fix(ladestation): Steuerbefehle in Diagnose erhalten --- LadestationStandAlone/module.php | 25 +++++++++++-------- docs/module/Ladestation-Stand-Alone/README.md | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/LadestationStandAlone/module.php b/LadestationStandAlone/module.php index 2f87ebe..4097517 100644 --- a/LadestationStandAlone/module.php +++ b/LadestationStandAlone/module.php @@ -588,7 +588,7 @@ class LadestationStandAlone extends IPSModule implements VerbraucherSchnittstell $this->setzeFahrzeugstromKandidatZurueck(); $transport = new LadestationTransport( - fn (array $anfrage): string => $this->fuehreHttpAnfrageAus($anfrage) + fn (array $anfrage): string => $this->fuehreHttpAnfrageAus($anfrage, true) ); $transport->ladestromSetzen( $this->ReadPropertyInteger('Geraetetyp'), @@ -601,16 +601,21 @@ class LadestationStandAlone extends IPSModule implements VerbraucherSchnittstell /** * @param array $anfrage */ - private function fuehreHttpAnfrageAus(array $anfrage): string + private function fuehreHttpAnfrageAus( + array $anfrage, + bool $alsGeraetebefehl = false + ): string { - $protokoll = [ - 'Methode' => $anfrage['Methode'], - 'URL' => $anfrage['URL'], - ]; - $this->setzeSichtbareVariable( - 'LetzterGeraetebefehl', - json_encode($protokoll, JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) - ); + if ($alsGeraetebefehl) { + $protokoll = [ + 'Methode' => $anfrage['Methode'], + 'URL' => $anfrage['URL'], + ]; + $this->setzeSichtbareVariable( + 'LetzterGeraetebefehl', + json_encode($protokoll, JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR) + ); + } if ($this->ReadPropertyBoolean('Testmodus')) { $url = (string) $anfrage['URL']; diff --git a/docs/module/Ladestation-Stand-Alone/README.md b/docs/module/Ladestation-Stand-Alone/README.md index f10ec75..d387fef 100644 --- a/docs/module/Ladestation-Stand-Alone/README.md +++ b/docs/module/Ladestation-Stand-Alone/README.md @@ -173,7 +173,7 @@ Nur mit `DiagnosevariablenAnzeigen=true` sichtbar: | `AenderungMoeglich` | Zeigt, ob das aktuelle Angebot mehr als eine Leistungsstufe enthaelt. | | `Stoerung` | Sammelstatus fuer Konfigurations- und Kommunikationsfehler. | | `Stoertext` | Letzte verstaendliche Fehlerbeschreibung. | -| `LetzterGeraetebefehl` | Letzte HTTP-Methode und URL ohne Zugangsdaten. | +| `LetzterGeraetebefehl` | Letzter Steuerbefehl mit HTTP-Methode und URL ohne Zugangsdaten; Statusabfragen ueberschreiben ihn nicht. | | `LeistungsangebotDiagnose` | Aktuelles Leistungsangebot als JSON-Liste in W. | Die Regellogik speichert ihren Zustand unabhaengig von der Sichtbarkeit der