2022-01-06 13:03:26 +01:00
|
|
|
<?php
|
2022-01-17 00:18:50 +01:00
|
|
|
class alerte_intrusion extends hook
|
2022-01-06 13:03:26 +01:00
|
|
|
{
|
|
|
|
public $hookName = "alerte_intrusion";
|
|
|
|
public $active = true;
|
|
|
|
|
2022-01-17 00:18:50 +01:00
|
|
|
protected $devicelist = array(
|
|
|
|
ENTREE_PORTE => array("contact", false),
|
|
|
|
GARAGE_PORTE => array("contact", false),
|
|
|
|
RDC_CHAMBRE_BAIE => array("contact", false),
|
|
|
|
RDC_SALON_BAIE => array("contact", false));
|
2022-01-06 13:03:26 +01:00
|
|
|
|
|
|
|
public $delay = 3; // amount of time in $timeunit
|
|
|
|
public $delayManual = 10; // amount of time in $timeunit for manual mode
|
|
|
|
public $timeUnit = "minute"; // unit of time for delay, second, minute, day, week, month, year
|
|
|
|
|
|
|
|
// callback fonction. Is called with these 4 parameters
|
2022-02-23 10:23:16 +01:00
|
|
|
public function callBack($device, $param, $value)
|
2022-01-06 13:03:26 +01:00
|
|
|
{
|
|
|
|
switch($param)
|
|
|
|
{
|
|
|
|
case "contact":
|
|
|
|
if ($value == false)
|
|
|
|
{
|
2022-01-28 23:05:58 +01:00
|
|
|
logger(ALERT, sprintf(_("%s est ouverte alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__);
|
2022-01-06 13:03:26 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$hooks["alerte_intrusion"] = new alerte_intrusion();
|
|
|
|
|
|
|
|
?>
|