1
0

added events configuration

This commit is contained in:
Daniel Tartavel 2022-07-10 13:57:38 +02:00
parent 6e216d776b
commit 97f8050d29
2 changed files with 21 additions and 4 deletions

4
config/events.php Normal file
View File

@ -0,0 +1,4 @@
<?php
?>

View File

@ -11,10 +11,6 @@ class alerte_intrusion extends hook
RDC_SALON_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 // callback fonction. Is called with these 4 parameters
public function callBack($device, $property, $value) public function callBack($device, $property, $value)
{ {
@ -29,6 +25,23 @@ class alerte_intrusion extends hook
break; 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(); $hooks["alerte_intrusion"] = new alerte_intrusion();