Neues Ladestationsmodul mit ocpp Modul erstellt.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
class CapabilityModel
|
||||
{
|
||||
public static function defaults(): array
|
||||
{
|
||||
return [
|
||||
'smartCharging' => false,
|
||||
'meterValues' => false,
|
||||
'phaseMetering' => false,
|
||||
'currentImportPerPhase' => false,
|
||||
'voltagePerPhase' => false,
|
||||
'powerImport' => false,
|
||||
'powerExport' => false,
|
||||
'energyImport' => false,
|
||||
'energyExport' => false,
|
||||
'numberPhases' => false,
|
||||
'phaseToUse' => false,
|
||||
'phaseSwitching' => false,
|
||||
'dataTransfer' => false,
|
||||
'getVariables' => false,
|
||||
'setVariables' => false,
|
||||
'transactionEvent' => false,
|
||||
'soc' => false,
|
||||
'temperature' => false,
|
||||
'signedMeterValue' => false,
|
||||
'bidirectional' => false
|
||||
];
|
||||
}
|
||||
|
||||
public static function detectFromBoot(string $version, array $payload): array
|
||||
{
|
||||
$capabilities = self::defaults();
|
||||
$capabilities['meterValues'] = true;
|
||||
|
||||
if ($version === '2.0.1' || $version === '2.1') {
|
||||
$capabilities['getVariables'] = true;
|
||||
$capabilities['setVariables'] = true;
|
||||
$capabilities['transactionEvent'] = true;
|
||||
$capabilities['smartCharging'] = true;
|
||||
}
|
||||
|
||||
if ($version === '2.1') {
|
||||
$capabilities['bidirectional'] = true;
|
||||
$capabilities['powerExport'] = true;
|
||||
$capabilities['energyExport'] = true;
|
||||
}
|
||||
|
||||
if (isset($payload['chargingStation']['model']) || isset($payload['chargePointModel'])) {
|
||||
$capabilities['dataTransfer'] = true;
|
||||
}
|
||||
|
||||
return $capabilities;
|
||||
}
|
||||
|
||||
public static function merge(array $base, array $updates): array
|
||||
{
|
||||
return array_replace($base, array_intersect_key($updates, $base));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user