This commit is contained in:
@@ -91,7 +91,7 @@ final class LadestationAdapter
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{Rohstatus: int, Istleistung_W: float, Iststrom_A?: float, Phasenzahl?: int}
|
||||
* @return array{Rohstatus: int, Istleistung_W: float, Sollstrom_A?: int, Maximalstrom_A?: int, Iststrom_A?: float, Phasenzahl?: int}
|
||||
*/
|
||||
public static function dekodiereStatus(int $geraetetyp, string $antwort): array
|
||||
{
|
||||
@@ -115,6 +115,20 @@ final class LadestationAdapter
|
||||
'Rohstatus' => (int) $daten['car'],
|
||||
'Istleistung_W' => (float) $daten['nrg'][11] * $leistungsfaktor,
|
||||
];
|
||||
if (isset($daten['amp']) && is_numeric($daten['amp'])) {
|
||||
$sollstrom = (int) $daten['amp'];
|
||||
$freigabeEntzogen = isset($daten['alw']) && $daten['alw'] === false;
|
||||
$erzwungenAus = $geraetetyp === self::GO_E_GEMINI
|
||||
&& isset($daten['frc'])
|
||||
&& (int) $daten['frc'] === 1;
|
||||
$status['Sollstrom_A'] = $freigabeEntzogen || $erzwungenAus ? 0 : $sollstrom;
|
||||
}
|
||||
if (isset($daten['ama']) && is_numeric($daten['ama'])) {
|
||||
$maximalstrom = (int) $daten['ama'];
|
||||
if ($maximalstrom >= 6 && $maximalstrom <= 32) {
|
||||
$status['Maximalstrom_A'] = $maximalstrom;
|
||||
}
|
||||
}
|
||||
if (isset($daten['nrg'][4], $daten['nrg'][5], $daten['nrg'][6])
|
||||
&& is_numeric($daten['nrg'][4])
|
||||
&& is_numeric($daten['nrg'][5])
|
||||
|
||||
Reference in New Issue
Block a user