Log in automations Fix

This commit is contained in:
JonatanRek 2019-09-18 09:38:24 +02:00
parent fc4a1edde0
commit 9458b01cea
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,5 @@
<?php
class AutomationManager{
public static $automation;
@ -33,7 +34,8 @@ class AutomationManager{
}
public function executeAll(){
$dateTimeOffset;
global $logManager;
$automations = Db::loadAll ("SELECT * FROM automation");
$dayNameNow = strtolower (date('D', time()));
@ -47,12 +49,12 @@ class AutomationManager{
if ($automation['active'] != 0){
if (in_array($dayNameNow, $actionDays)){
if (in_array($onValue['type'], ['sunSet','time','now'])) {
if (in_array($onValue['type'], ['sunSet', 'sunRise', 'time','now'])) {
if ($onValue['type'] == 'sunSet') {
$value = date_sunset($value, SUNFUNCS_RET_TIMESTAMP, 50.0755381 , 14.4378005, 90, $dateTimeOffset);
$value = date_sunset($value, SUNFUNCS_RET_TIMESTAMP, 50.0755381 , 14.4378005, 90);
} else if ($onValue['type'] == 'sunRise') {
$value = date_sunrise($value, SUNFUNCS_RET_TIMESTAMP, 50.0755381 , 14.4378005, 90, $dateTimeOffset);
$value = date_sunrise($value, SUNFUNCS_RET_TIMESTAMP, 50.0755381 , 14.4378005, 90);
} else if ($onValue['type'] == 'time') {
$onValue = explode(':',$onValue['value']);
$today = date_create('now');