1
0

debugging

This commit is contained in:
2022-01-29 19:58:01 +01:00
parent 425107cec7
commit 719a45fa4e
8 changed files with 41 additions and 29 deletions

View File

@ -23,7 +23,7 @@ class rdc_sdb_eclairage extends hook
RDC_SDB_WC_ECLAIRAGE => array("state_l1", false)
);
// callback fonction. Is called with these 4 parameters
// callback fonction. Is called with these 3 parameters
public function callBack(&$device, $property, $value)
{
global $devices, $indexDevices;
@ -33,19 +33,22 @@ class rdc_sdb_eclairage extends hook
case "occupancy":
if ($value == ON)
{
$this->send("ON");
setDelay($device, $this->delay, $this->timeUnit, "state_l1", "OFF", true);
if (getValue(RDC_SDB_WC_ECLAIRAGE, "state_l1") != "ON")
{
$this->send("ON");
}
//setDelay($indexDevices[RDC_SDB_WC_ECLAIRAGE], $this->delay, $this->timeUnit, "state_l1", "OFF", true);
$device->method = AUTO;
}
break;
case "state_l1":
if ($value == ON)
{
setDelay($device, $this->delayManual, $this->timeUnit, "state_l1", "OFF", true);
setDelay($indexDevices[RDC_SDB_WC_ECLAIRAGE], $this->delayManual, $this->timeUnit, "state_l1", "OFF", true);
$device->method = MANUAL;
}elseif ($value = OFF)
{
deleteEvent(searchEvent($device, "state_l1", "OFF"));
removeEvent($indexDevices[RDC_SDB_WC_ECLAIRAGE], "state_l1", "OFF");
}
break;
}