Permalink
Browse files

Fixed a bug in calling the Lost method

  • Loading branch information...
thesoultaker48 committed Aug 30, 2018
1 parent 05f60b8 commit 5c9212cf6165cf6489aab6e6210e60d1cb84961f
Showing with 6 additions and 4 deletions.
  1. +6 −4 modules/bluetoothdevices/bluetoothdevices.class.php
@@ -365,10 +365,12 @@ function processCycle() {
}
} else {
$lastTimestamp = intval($obj->getProperty('lastTimestamp'));
if(time()-$lastTimestamp > intval($this->config['scanTimeout'])) {
echo date('Y/m/d H:i:s').' Device lost: '.$address.PHP_EOL;
$obj->setProperty('online', 0);
$obj->callMethod('Lost', array('ADDRESS'=>$address));
if($obj->getProperty('online') == 1) {
if(time()-$lastTimestamp > intval($this->config['scanTimeout'])) {
echo date('Y/m/d H:i:s').' Device lost: '.$address.PHP_EOL;
$obj->setProperty('online', 0);
$obj->callMethod('Lost', array('ADDRESS'=>$address));
}
}
}
}

0 comments on commit 5c9212c

Please sign in to comment.