1
0

hooks are now in array

This commit is contained in:
2022-01-01 06:26:02 +01:00
parent f2f8e27c89
commit 4e9aa8aeb5
3 changed files with 16 additions and 14 deletions

View File

@ -1,9 +1,10 @@
<?php
class panneau_salon
class rdc_panneau_salon
{
// list of devices we are listening to
private $devicelist = array("0x00124b0022ebac5c", "0x588e81fffe2cf695", "0x00124b001f900753", "0x04cf8cdf3c78aff0");
public $delay = 3;
public $timeUnit = "min";
public $delay = 3; // amount of time in $timeunit
public $timeUnit = "minutes"; // unit of time for delay, second, minute, day, week, month, year
function __construct()
{
@ -13,13 +14,12 @@ class panneau_salon
$indexDevices[$ieeeAddress]->functions[] = array($this,"callback");
//print_r($indexDevices[$ieeeAddress]);
}
}
// callback fonction. Is called with these 4 parameters
public function callBack($topic, $fn, $param, $value)
{
global $devices, $indexDevices;
switch($param)
{
case "occupancy":
@ -47,7 +47,7 @@ class panneau_salon
}
}
$panneau_salon = new panneau_salon();
$hooks["rdc/panneau/salon"] = new rdc_panneau_salon();
//assignation of the function to the sensors devices
//$indexDevices["0x00124b0022ebac5c"]->functions[] = array($panneau_salon,"getCallback"); // rdc-salon-mvmt2
//$indexDevices["0x588e81fffe2cf695"]->functions[] = array($panneau_salon,"getCallback"); // rdc-salon-mvmt