debug rdc_store et rdc_wc_eclairage\nmise en page constant.php
This commit is contained in:
@ -3,14 +3,15 @@
|
||||
class rdc_wc_eclairage extends hook
|
||||
{
|
||||
public $hookName = "rdc_wc_eclairage";
|
||||
public $active = true; //enable/disable hook (true => enabled)
|
||||
|
||||
protected $devicelist = array(
|
||||
RDC_SDB_WC_ECLAIRAGE => "state_l2",
|
||||
RDC_WC_MVMT => "occupancy"
|
||||
);
|
||||
|
||||
public $delay = 3; // amount of time in $timeunit
|
||||
public $delayManual = 15; // amount of time in $timeunit for manual mode
|
||||
public $delay = 1; // 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
|
||||
@ -26,7 +27,7 @@ class rdc_wc_eclairage extends hook
|
||||
logger(DEBUG, "CASE: state_l2", __FILE__ . ":" . __LINE__);
|
||||
if ($value == "ON")
|
||||
{
|
||||
if ($targetDevice->properties["state_l2"]["method"] !== AUTO)
|
||||
if ($targetDevice->properties["state_l2"]["method"] == IDLE)
|
||||
{
|
||||
$targetDevice->properties["state_l2"]["method"] = MANUAL;
|
||||
setDelay($device, $this->delayManual, $this->timeUnit, "state_l2", "OFF", true);
|
||||
@ -39,12 +40,11 @@ class rdc_wc_eclairage extends hook
|
||||
break;
|
||||
case "occupancy":
|
||||
logger(DEBUG, "CASE: occupancy", __FILE__ . ":" . __LINE__);
|
||||
if ($value == true and $targetDevice->properties["state_l2"]["method"] == IDLE)
|
||||
if ($value === true and $targetDevice->properties["state_l2"]["method"] == IDLE)
|
||||
{
|
||||
$targetDevice->properties["state_l2"]["method"] = AUTO;
|
||||
//setDelay($device, $this->delay, $this->timeUnit, "state_l2", "OFF", true,IDLE);
|
||||
$this->send($targetDevice, "ON");
|
||||
}elseif ($value == false and $targetDevice->properties["state_l2"]["method"] != MANUAL)
|
||||
}elseif ($value === false and $targetDevice->properties["state_l2"]["method"] == AUTO)
|
||||
{
|
||||
//$targetDevice->properties["state_l2"]["method"] = IDLE;
|
||||
//$this->send($targetDevice, "OFF");
|
||||
|
Reference in New Issue
Block a user