[FIX] correct remaining time calculation if time is after midnoght

This commit is contained in:
Jannik Beyerstedt 2017-08-03 00:07:14 +02:00
parent b0a675ab3d
commit e31b31e6f7
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class LightStatus {
$this->changeTime = (int)(($stopTime - $currentTime) / 60);
$this->waitTime = 1;
return true;
} elseif ($currentTime < $startTime || ($startTime+(24*60*60) - $currentTime) < (12*60*60) ) {
} elseif ( ($startTime - $currentTime) < (12*60*60) || ($startTime+(24*60*60) - $currentTime) < (12*60*60) ) {
// right before the next time interval
$this->state = false;
if ($currentTime < $startTime) {