fix(ladestation): Fahrzeugstrom nach Lernzeit begrenzen
Tests / test (push) Successful in 56s

This commit is contained in:
dh
2026-09-29 12:47:23 +00:00
parent b3b868cd2a
commit ace1821213
9 changed files with 247 additions and 21 deletions
+18 -5
View File
@@ -91,7 +91,7 @@ final class LadestationAdapter
}
/**
* @return array{Rohstatus: int, Istleistung_W: float}
* @return array{Rohstatus: int, Istleistung_W: float, Iststrom_A?: float}
*/
public static function dekodiereStatus(int $geraetetyp, string $antwort): array
{
@@ -110,12 +110,25 @@ final class LadestationAdapter
throw new RuntimeException('Die go-e-Antwort enthaelt nicht alle Statusfelder.');
}
$faktor = $geraetetyp === self::GO_E_ALT ? 10.0 : 1.0;
return [
$leistungsfaktor = $geraetetyp === self::GO_E_ALT ? 10.0 : 1.0;
$status = [
'Rohstatus' => (int) $daten['car'],
'Istleistung_W' => (float) $daten['nrg'][11] * $faktor,
'Istleistung_W' => (float) $daten['nrg'][11] * $leistungsfaktor,
];
if (isset($daten['nrg'][4], $daten['nrg'][5], $daten['nrg'][6])
&& is_numeric($daten['nrg'][4])
&& is_numeric($daten['nrg'][5])
&& is_numeric($daten['nrg'][6])
) {
$stromfaktor = $geraetetyp === self::GO_E_ALT ? 0.1 : 1.0;
$status['Iststrom_A'] = max(
(float) $daten['nrg'][4],
(float) $daten['nrg'][5],
(float) $daten['nrg'][6]
) * $stromfaktor;
}
return $status;
}
if ($geraetetyp === self::SMART_ME_PICO) {