mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Automations Endpoint Detail + Cron Endpoint
This commit is contained in:
1 parent
38b29a2a4a
commit
7ea4a90980
4 files changed
+39
-7
No files matched your search
@@ -7,9 +7,9 @@ class AutomationsApi extends ApiController
|
||||
{
|
||||
//$this->requireAuth();
|
||||
$response = [];
|
||||
$automationData = AutomationManager::getAll();
|
||||
$automationsData = AutomationManager::getAll();
|
||||
|
||||
foreach ($automationData as $automationKey => $automation) {
|
||||
foreach ($automationsData as $automationKey => $automation) {
|
||||
$response[] = [
|
||||
"automation_id" => $automation['automation_id'],
|
||||
"name" => $automation['name'],
|
||||
@@ -19,4 +19,23 @@ class AutomationsApi extends ApiController
|
||||
|
||||
$this->response($response);
|
||||
}
|
||||
|
||||
public function detail($automationId)
|
||||
{
|
||||
//$this->requireAuth();
|
||||
|
||||
$response = null;
|
||||
$automationData = AutomationManager::getById($automationId);
|
||||
|
||||
$response = [
|
||||
'automation_id' => $automationData['automation_id'],
|
||||
'last_execution_time' => $automationData['last_execution_time'],
|
||||
'owner' => $automationData['owner_id'],
|
||||
'conditions' => $automationData['conditions'],
|
||||
'tasks' => $automationData['tasks'],
|
||||
];
|
||||
|
||||
$this->response($response);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user