Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Fixed a bug in calling the Lost method
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Avdeev committed Aug 30, 2018
1 parent 05f60b8 commit 5c9212c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/bluetoothdevices/bluetoothdevices.class.php
Expand Up @@ -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));
}
}
}
}
Expand Down

0 comments on commit 5c9212c

Please sign in to comment.