This commit is contained in:
@@ -221,6 +221,12 @@ class EaseeGateway extends IPSModule
|
||||
$seriennummer,
|
||||
(float) ($anfrage['amps'] ?? -1)
|
||||
), JSON_THROW_ON_ERROR);
|
||||
|
||||
case 'StartCharging':
|
||||
return json_encode(
|
||||
$this->sendeLadestart($seriennummer),
|
||||
JSON_THROW_ON_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
return json_encode([
|
||||
@@ -670,6 +676,24 @@ class EaseeGateway extends IPSModule
|
||||
);
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
private function sendeLadestart(string $seriennummer): array
|
||||
{
|
||||
if ($seriennummer === '') {
|
||||
return ['success' => false, 'error' => 'Seriennummer fehlt.'];
|
||||
}
|
||||
if ($this->ReadPropertyBoolean('Testmodus')) {
|
||||
return ['success' => true, 'httpCode' => 200, 'body' => '{}'];
|
||||
}
|
||||
|
||||
return $this->autorisierteApiAnfrage(
|
||||
'POST',
|
||||
'/api/chargers/' . rawurlencode($seriennummer)
|
||||
. '/commands/start_charging',
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
private function autorisierteApiAnfrage(
|
||||
string $methode,
|
||||
|
||||
Reference in New Issue
Block a user