Little Tweeks on Light Value Handling

This commit is contained in:
JonatanRek 2019-11-26 13:32:45 +01:00
parent a5a5baffc9
commit 3e71be821c

View File

@ -78,7 +78,7 @@ class Home extends Template
$operator = '=='; $operator = '==';
$breakValue = 1; $breakValue = 1;
if ($lastValue != 1 || $lastValue != 0) { //Digital Light Senzor if ($lastValue != 1 || $lastValue != 0) { //Digital Light Senzor
$operator = '<='; $operator = '<';
$breakValue = 810; $breakValue = 810;
} }
break; break;
@ -108,7 +108,7 @@ class Home extends Template
//parsing last events values //parsing last events values
foreach ($events as $key => $value) { foreach ($events as $key => $value) {
$events[$key]['value'] = $replacementFalse; $events[$key]['value'] = $replacementFalse;
if (Utilities::checkOperator($lastValue, $operator, $breakValue)) { if (Utilities::checkOperator($value['value'], $operator, $breakValue)) {
$events[$key]['value'] = $replacementTrue; $events[$key]['value'] = $replacementTrue;
} }
} }
@ -156,6 +156,7 @@ class Home extends Template
'icon' => $deviceData['icon'], 'icon' => $deviceData['icon'],
'room' => $deviceData['room_id'], 'room' => $deviceData['room_id'],
'token' => $deviceData['token'], 'token' => $deviceData['token'],
'type' => $deviceData['type'],
'sleepTime' => $deviceData['sleep_time'], 'sleepTime' => $deviceData['sleep_time'],
'approved' => $deviceData['approved'], 'approved' => $deviceData['approved'],
'permission' => $permissionArray, 'permission' => $permissionArray,