Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Aug 3, 2023
1 parent 317c389 commit 32f272c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ONVIF IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2014,8 +2014,8 @@ private function SetRenewInterval(object $Result): void
$CurrentTime = DateTimeImmutable::createFromFormat(DATE_W3C, $Result->CurrentTime);
$TerminationTime = DateTimeImmutable::createFromFormat(DATE_W3C, $Result->TerminationTime);
$TimeDiff = $CurrentTime->diff($TerminationTime);
$Interval = $TerminationTime->getTimestamp() - $CurrentTime->getTimestamp() - 5;
if ($Interval < 5) { // Falls Gerät falsche Timestamps liefert ()
$Interval = $TerminationTime->getTimestamp() - $CurrentTime->getTimestamp();
if ($Interval < 10) { // Falls Gerät falsche Timestamps liefert ()
$this->TerminationTime = 'PT10S';
$Interval = 10;
} elseif ($Interval == 60) { // 1 Minute ist üblich, aber viele China Böller können kein XML-DateTime, sondern wollen immer PT60S.
Expand All @@ -2024,7 +2024,7 @@ private function SetRenewInterval(object $Result): void
$this->TerminationTime = $TimeDiff->format('PT%iM%sS');
}
$this->SendDebug('TerminationTime', $this->TerminationTime, 0);
$this->SendDebug('Renew Interval', $Interval, 0);
$this->SetTimerInterval('RenewSubscription', $Interval * 1000);
$this->SendDebug('Renew Interval', $Interval - 5, 0);
$this->SetTimerInterval('RenewSubscription', ($Interval - 5) * 1000);
}
}

0 comments on commit 32f272c

Please sign in to comment.