récupération après crash
This commit is contained in:
@ -48,20 +48,22 @@ class rdc_salon_eclairage extends hook
|
||||
$method = $deviceTarget->properties["state"]["method"];
|
||||
logger(INFO, sprintf (_("CASE: %s => "), $param) . bool2string($value), __FILE__ . ":" . __LINE__);
|
||||
//print_r(getValue(RDC_SALON_LUMINOSITE, "illuminance_lux"));
|
||||
if ($value == ON and $method == IDLE)
|
||||
if ($value == ON)
|
||||
{
|
||||
logger(INFO, _("illuminance value : ") . $illuminance, __FILE__ . ":" . __LINE__);
|
||||
if ($illuminance <= $this->luminance_min)
|
||||
if ($method == IDLE)
|
||||
{
|
||||
logger(INFO, _("setting to ON"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "ON", false, AUTO);
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
logger(INFO, _("illuminance value : ") . $illuminance, __FILE__ . ":" . __LINE__);
|
||||
if ($illuminance <= $this->luminance_min)
|
||||
{
|
||||
logger(INFO, _("setting to ON"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "ON", false, AUTO);
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
}
|
||||
}
|
||||
}else
|
||||
}elseif ($method == AUTO)
|
||||
{
|
||||
logger(INFO, _("Value is OFF and method is ") . $method, __FILE__ . ":" . __LINE__);
|
||||
if ((testActionneurs($this->actionneurs) == false) and ($method == AUTO))
|
||||
//if ((getValue(RDC_SALON_MVMT, "occupancy") == OFF) and (getValue(RDC_SALON_MVMT2, "occupancy") == OFF) and $method == AUTO)
|
||||
if (testActionneurs($this->actionneurs) == 0)
|
||||
{
|
||||
logger(INFO, _("Setting to OFF"), __FILE__ . ":" . __LINE__);
|
||||
$this->send($deviceTarget, "OFF", false, IDLE);
|
||||
@ -97,10 +99,13 @@ class rdc_salon_eclairage extends hook
|
||||
case "state":
|
||||
logger(INFO, _("CASE : State"), __FILE__ . ":" . __LINE__);
|
||||
$method = $deviceTarget->properties["state"]["method"];
|
||||
if($value == "ON" and $method == IDLE)
|
||||
if($value == "ON")
|
||||
{
|
||||
$deviceTarget->properties["state"]["method"] = MANUAL;
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
if ($method == IDLE)
|
||||
{
|
||||
$deviceTarget->properties["state"]["method"] = MANUAL;
|
||||
removeEvent($deviceTarget, "state", "OFF");
|
||||
}
|
||||
}else
|
||||
{
|
||||
$deviceTarget->properties["state"]["method"] = IDLE;
|
||||
|
Reference in New Issue
Block a user