This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user