Automation Execution Time & Owner

This commit is contained in:
JonatanRek
2020-02-21 14:25:25 +01:00
parent d8c7a54446
commit 1e973d2d8f
4 changed files with 28 additions and 3 deletions

View File

@@ -27,12 +27,19 @@ class Automation extends Template
'state' => $subDeviceState,
];
}
//TODO: Transaltion add
$executionTime = 'never';
if ($automationData['execution_time'] != '0000-00-00 00:00:00') {
$executionTime = date(DATEFORMAT,strtotime($automationData['execution_time']));
}
$automations[$automationData['automation_id']] = [
'name' => $automationData['name'],
'owner_name' => $userManager->getUserId($automationData['owner_id'])['username'],
'onDays' => json_decode($automationData['on_days']),
'ifSomething' => $automationData['if_something'],
'doSomething' => $doSomething,
'active' => $automationData['active'],
'execution_time' => $executionTime,
];
}
@@ -52,7 +59,7 @@ class Automation extends Template
$template = new Template('automation');
$template->prepare('baseDir', BASEDIR);
$template->prepare('debugMod', DEBUGMOD);
$template->prepare('debugMod', DEBUGMOD);
$template->prepare('title', 'Automation');
$template->prepare('langMng', $langMng);
$template->prepare('userManager', $userManager);