new script presence.php\ndebug
This commit is contained in:
@ -43,26 +43,34 @@ class alerte_intrusion extends hook
|
||||
}
|
||||
}
|
||||
|
||||
public function testPortes($send=true, $opened=true) :array
|
||||
public function testPortes($deviceList=false, $send=true, $opened=true) :array
|
||||
{
|
||||
global $indexDevices;
|
||||
$portes = array();
|
||||
|
||||
logger(DEBUG, _("Function alerte_intrusion->testPorte"), __FILE__ . ":" . __LINE__);
|
||||
|
||||
if ($deviceList === false) $deviceList = $this->deviceList;
|
||||
$msg = "";
|
||||
foreach ($this->devicelist as $device => $property)
|
||||
foreach ($deviceList as $device => $property)
|
||||
{
|
||||
if (!$opened)
|
||||
//echo "device: " . $device . "\n";
|
||||
//echo "opened = " . bool2string($opened);
|
||||
//echo " value = " . var_dump($indexDevices[$device]->properties[$property]);
|
||||
|
||||
if ($opened)
|
||||
{
|
||||
if($indexDevices[$device]->properties[$property] == false)
|
||||
if($indexDevices[$device]->properties[$property]["value"] === false)
|
||||
{
|
||||
//echo "porte opened";
|
||||
$portes[] = $indexDevices[$device]->friendlyName;
|
||||
$msg .= $indexDevices[$device]->friendlyName . "\n";
|
||||
}
|
||||
}else
|
||||
{
|
||||
if($indexDevices[$device]->properties[$property] == true)
|
||||
if($indexDevices[$device]->properties[$property]["value"] === true)
|
||||
{
|
||||
//echo "porte closed";
|
||||
$portes[] = $indexDevices[$device]->friendlyName;
|
||||
$msg .= $indexDevices[$device]->friendlyName . "\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user