1
0
moha/hooks/scripts/rdc_portes_ouvertes.php
daniel Tartavel 0d35b1ff3f - lots of debugging
- beginning to add graphical stats
- beginning to add device by type
- added a dashboard "etage"
- begining to add notification to multiple recipients in freemobile hook
2022-03-28 00:40:34 +02:00

37 lines
999 B
PHP

<?php
class alerte_intrusion extends hook
{
public $hookName = "alerte_intrusion";
public $active = true;
protected $devicelist = array(
ENTREE_PORTE => "contact",
GARAGE_PORTE => "contact",
RDC_CHAMBRE_BAIE => "contact",
RDC_SALON_BAIE => "contact"
);
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
public function callBack($device, $property, $value)
{
logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
switch($property)
{
case "contact":
if ($value == false)
{
logger(ALERT, sprintf(_("%s est ouverte alors que personne n'est présent"), $device->friendlyName), __FILE__ . ":" . __LINE__);
}
break;
}
}
}
$hooks["alerte_intrusion"] = new alerte_intrusion();
?>