1
0

some debbuging :-(

This commit is contained in:
2022-06-10 12:44:09 +02:00
parent cde4d728cf
commit b2f79dd49c
8 changed files with 80 additions and 64 deletions

View File

@ -9,15 +9,15 @@ class rdc_sdb_eclairage extends hook
// public $active = true;
//public $initlialized = false;
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 = 20; // 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
// devicelist[$ieeAddress][0] => property to watch
// devicelist[$ieeAddress][1] => initialized = true
protected $devicelist = array(
RDC_SDB_DOUCHE_MVMT => "occupancy",
//RDC_SDB_DOUCHE_MVMT => "occupancy",
RDC_SDB_PLAFOND_MVMT => "occupancy",
RDC_SDB_MVMT => "occupancy",
RDC_SDB_WC_ECLAIRAGE => "state_l1"
@ -40,12 +40,10 @@ class rdc_sdb_eclairage extends hook
{
$this->send("ON");
$deviceTarget->properties["state_l1"]["method"] = AUTO;
}
break;
case "state_l1":
logger(DEBUG, _("CASE: state_l1"), __FILE__ . ":" . __LINE__);
if ($value == "ON")
}else
{
//$delay = $this->delay;
//setDelay($deviceTarget, $delay, $this->timeUnit, "state_l1", "OFF", true, IDLE);
if ($deviceTarget->properties["state_l1"]["method"] != AUTO)
{
$delay = $this->delayManual;
@ -56,7 +54,17 @@ class rdc_sdb_eclairage extends hook
$deviceTarget->properties["state_l1"]["method"] = MANUAL;
}
setDelay($deviceTarget, $delay, $this->timeUnit, "state_l1", "OFF", true, IDLE);
}elseif ($value == "OFF")
}
break;
case "state_l1":
logger(DEBUG, _("CASE: state_l1"), __FILE__ . ":" . __LINE__);
/*if ($value == "ON")
{
}else*/
if ($value == "OFF")
{
removeEvent($deviceTarget, "state_l1", "OFF");
$deviceTarget->properties["state_l1"]["method"] = IDLE;