correction de bugs
This commit is contained in:
@ -10,11 +10,13 @@ class rdc_salon_eclairage extends hook
|
||||
RDC_SALON_MVMT2 => "occupancy",
|
||||
RDC_ENTREE_PORTE => "contact",
|
||||
RDC_SALON_LUMINOSITE => "illuminance_lux",
|
||||
RDC_SALON_ECLAIRAGE_PANNEAU => "state"
|
||||
RDC_SALON_ECLAIRAGE_PANNEAU => "state",
|
||||
RDC_SALON_PRESENCE => "presence"
|
||||
);
|
||||
protected $actionneurs = array(
|
||||
array(RDC_SALON_MVMT, "occupancy", 1),
|
||||
array(RDC_SALON_MVMT2, "occupancy", 1)
|
||||
array(RDC_SALON_MVMT2, "occupancy", 1),
|
||||
array(RDC_SALON_PRESENCE => "presence", 1)
|
||||
);
|
||||
public $delay = 3; // amount of time in $timeunit
|
||||
public $timeUnit = "minute"; // unit of time for delay, second, minute, hour, day, week, month, year
|
||||
@ -41,6 +43,8 @@ class rdc_salon_eclairage extends hook
|
||||
logger (INFO, _("property => ") . $param . _("value =>") . bool2string($value), __FILE__ . ":" . __LINE__);
|
||||
switch($param)
|
||||
{
|
||||
case "presence":
|
||||
logger(INFO, _("CASE: Présence => ") . bool2string($value), __FILE__ . ":" . __LINE__);
|
||||
case "occupancy":
|
||||
$method = $deviceTarget->properties["state"]["method"];
|
||||
logger(INFO, _("CASE: Occupancy => ") . bool2string($value), __FILE__ . ":" . __LINE__);
|
||||
@ -57,7 +61,8 @@ class rdc_salon_eclairage extends hook
|
||||
}else
|
||||
{
|
||||
logger(INFO, _("Value is OFF"), __FILE__ . ":" . __LINE__);
|
||||
if ((getValue(RDC_SALON_MVMT, "occupancy") == OFF) and (getValue(RDC_SALON_MVMT2, "occupancy") == OFF) and $method == AUTO)
|
||||
if (testActionneurs($this->actionneurs) and $method = AUTO)
|
||||
//if ((getValue(RDC_SALON_MVMT, "occupancy") == OFF) and (getValue(RDC_SALON_MVMT2, "occupancy") == OFF) and $method == AUTO)
|
||||
{
|
||||
logger(INFO, _("Setting to OFF"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "OFF", false, IDLE);
|
||||
@ -65,6 +70,7 @@ class rdc_salon_eclairage extends hook
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "contact":
|
||||
$method = $deviceTarget->properties["state"]["method"];
|
||||
logger(INFO, _("CASE: Contact Door"), __FILE__ . ":" . __LINE__);
|
||||
@ -78,6 +84,7 @@ class rdc_salon_eclairage extends hook
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "illuminance_lux":
|
||||
logger(INFO, _("CASE : Illuminance"), __FILE__ . ":" . __LINE__);
|
||||
if ($value >= $this->luminance_max and $deviceTarget->properties["state"]["value"] == "ON")
|
||||
@ -87,6 +94,7 @@ class rdc_salon_eclairage extends hook
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
}
|
||||
break;
|
||||
|
||||
case "state":
|
||||
logger(INFO, _("CASE : State"), __FILE__ . ":" . __LINE__);
|
||||
$method = $deviceTarget->properties["state"]["method"];
|
||||
|
Reference in New Issue
Block a user