1
0

debugging

This commit is contained in:
2022-01-17 00:18:50 +01:00
parent cd20e973cd
commit 4fb5504cdc
18 changed files with 379 additions and 269 deletions

View File

@ -1,40 +1,31 @@
<?php
class rdc_sdb_eclairage
class rdc_sdb_eclairage extends hook
{
public $hookName = "rdc_sdb_eclairage";
public $active = true;
/* already defined in hook class */
// public $active = true;
//public $initlialized = false;
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
// list of devices we are listening to
// 0x00158d0003f0f3b4 douche mvmnt
// 0x842e14fffe1c0cd1 plafond mvmnt
// 0x00124b0022ec05dc mvmnt
// 0x00158d0005c1a998 module commutateur => state_l1
private $devicelist = array(
"0x00158d0003f0f3b4" => "occupancy",
"0x842e14fffe1c0cd1" => "occupancy",
"0x00124b0022ec05dc" => "occupancy",
RDC_SDB_WC_ECLAIRAGE => "state_l1"
// devicelist[$ieeAddress][0] => property to watch
// devicelist[$ieeAddress][1] => initialized = true
protected $devicelist = array(
"0x00158d0003f0f3b4" => array("occupancy", false),
"0x842e14fffe1c0cd1" => array("occupancy", false),
"0x00124b0022ec05dc" => array("occupancy", false),
RDC_SDB_WC_ECLAIRAGE => array("state_l1", false)
);
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
function __construct()
{
global $indexDevices;
// assigne the function to the sensors devices
if ($this->active === true)
{
foreach ($this->devicelist as $ieeeAddress => $property)
{
$indexDevices[$ieeeAddress]->$property["functions"][] = array($this,"callback");
}
}
}
// callback fonction. Is called with these 4 parameters
public function callBack(&$device, $property, $value)
{
@ -73,6 +64,6 @@ class rdc_sdb_eclairage
$device->set(null);
}
}
$hooks["rdc_sdb_eclairage"] = new rdc_sdb_eclairage();
?>