Automation api Endpoint

This commit is contained in:
2021-02-16 14:28:31 +01:00
parent 821c0926e8
commit 38b29a2a4a
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
class AutomationsApi extends ApiController
{
public function default()
{
//$this->requireAuth();
$response = [];
$automationData = AutomationManager::getAll();
foreach ($automationData as $automationKey => $automation) {
$response[] = [
"automation_id" => $automation['automation_id'],
"name" => $automation['name'],
"enabled" => $automation['enabled'],
];
}
$this->response($response);
}
}