some adjustments
This commit is contained in:
@@ -28,30 +28,38 @@ class alerte_intrusion extends hook
|
||||
case "contact":
|
||||
if ($value == false)
|
||||
{
|
||||
logger(ALERT, sprintf(_("%s est ouverte alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
logger(ALERT, sprintf(_("%s vient de s'ouvrir alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
}else
|
||||
{
|
||||
logger(ALERT, sprintf(_("%s vient de se fermer alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__);
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function testPortes()
|
||||
public function testPortes($send=true) :array
|
||||
{
|
||||
global $indexDevices;
|
||||
$portes = array();
|
||||
logger(DEBUG, _("Function alerte_intrusion->testPorte"), __FILE__ . ":" . __LINE__);
|
||||
|
||||
$msg = "";
|
||||
foreach ($this->devicelist as $device => $property)
|
||||
{
|
||||
if($indexDevices[$device]->properties[$property] != false)
|
||||
if($indexDevices[$device]->properties[$property] == false)
|
||||
{
|
||||
$msg .= $indexDevices[$device]->friendlyName . " is open" . EOL;
|
||||
$portes[] = $indexDevices[$device]->friendlyName;
|
||||
$msg .= $indexDevices[$device]->friendlyName . "\n";
|
||||
}
|
||||
}
|
||||
if (!empty($msg))
|
||||
if ($send)
|
||||
{
|
||||
logger(ALERT, $msg, __FILE__ . ":" . __LINE__);
|
||||
logger(ALERT, _("doors opened :") . $msg, null ,$device);
|
||||
}
|
||||
return nl2br($msg);
|
||||
return $portes;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user