Created API endpoints to undo battery charge cycles and chore executions (references #63)

This commit is contained in:
Bernd Bestel
2018-10-27 10:55:30 +02:00
parent 1f3dd58ddf
commit fe83e2fa6f
8 changed files with 164 additions and 6 deletions

View File

@@ -49,4 +49,17 @@ class BatteriesApiController extends BaseApiController
{
return $this->ApiResponse($this->BatteriesService->GetCurrent());
}
public function UndoChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
try
{
$this->ApiResponse($this->BatteriesService->UndoChargeCycle($args['chargeCycleId']));
return $this->ApiResponse(array('success' => true));
}
catch (\Exception $ex)
{
return $this->VoidApiActionResponse($response, false, 400, $ex->getMessage());
}
}
}