1
0

a lot of bugs corrected\nrdc_wc_eclairage

This commit is contained in:
2022-03-13 22:33:26 +01:00
parent 9dde1c2d53
commit c8772aeda0
24 changed files with 534 additions and 191 deletions

View File

@ -17,10 +17,10 @@ class rdc_sdb_eclairage extends hook
// devicelist[$ieeAddress][0] => property to watch
// devicelist[$ieeAddress][1] => initialized = true
protected $devicelist = array(
//RDC_SDB_DOUCHE_MVMT => array("occupancy", false),
RDC_SDB_PLAFOND_MVMT => array("occupancy", false),
RDC_SDB_MVMT => array("occupancy", false),
RDC_SDB_WC_ECLAIRAGE => array("state_l1", false)
RDC_SDB_DOUCHE_MVMT => "occupancy",
RDC_SDB_PLAFOND_MVMT => "occupancy",
RDC_SDB_MVMT => "occupancy",
RDC_SDB_WC_ECLAIRAGE => "state_l1"
);
// callback fonction. Is called with these 3 parameters
@ -29,10 +29,11 @@ class rdc_sdb_eclairage extends hook
global $indexDevices;
//var_dump($value);
$deviceTarget = $indexDevices[RDC_SDB_WC_ECLAIRAGE];
logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__);
switch($property)
{
case "occupancy":
logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__);
if ($value == ON)
{
if (getValue($deviceTarget->ieeeAddress, "state_l1") != "ON")
@ -44,6 +45,7 @@ class rdc_sdb_eclairage extends hook
}
break;
case "state_l1":
logger(DEBUG, _("CASE: state_l1"), __FILE__ . ":" . __LINE__);
if ($value == "ON")
{
setDelay($deviceTarget, $this->delay, $this->timeUnit, "state_l1", "OFF", true);