diff --git a/config/events.php b/config/events.php new file mode 100644 index 0000000..6eff33c --- /dev/null +++ b/config/events.php @@ -0,0 +1,4 @@ + diff --git a/hooks/scripts/rdc_portes_ouvertes.php b/hooks/scripts/rdc_portes_ouvertes.php index 088ab63..480fad3 100644 --- a/hooks/scripts/rdc_portes_ouvertes.php +++ b/hooks/scripts/rdc_portes_ouvertes.php @@ -11,10 +11,6 @@ class alerte_intrusion extends hook 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) { @@ -29,6 +25,23 @@ class alerte_intrusion extends hook break; } } + + public function test() + { + global $indexDevices; + $msg = ""; + foreach ($this->devicelist as $device => $property) + { + if($indexDevices[$device]->properties[$property] != false) + { + $msg .= $indexDevices->friendlyName . " is open" . EOL; + } + } + if ($msg != "") + { + logger(ALERT, $msg, __FILE__ . ":" . __LINE__); + } + } } $hooks["alerte_intrusion"] = new alerte_intrusion();