1
0

a lot of debug

This commit is contained in:
2022-04-23 02:00:52 +02:00
parent f8fc3f63ec
commit d1f1065e44
21 changed files with 544 additions and 217 deletions

View File

@@ -26,8 +26,9 @@ class rdc_salon_eclairage extends hook
$lux = $indexDevices[RDC_SALON_LUMINOSITE];
$mvmt = $indexDevices[RDC_SALON_MVMT];
$mvmt2 = $indexDevices[RDC_SALON_MVMT2];
logger (INFO, _("property => ") . $param . _("value =>") . bool2string($value), __FILE__ . ":" . __LINE__);
$illuminance = getValue(RDC_SALON_LUMINOSITE, "illuminance_lux");
logger (INFO, _("property => ") . $param . _("value =>") . bool2string($value), __FILE__ . ":" . __LINE__);
switch($param)
{
case "occupancy":
@@ -35,7 +36,6 @@ class rdc_salon_eclairage extends hook
//print_r(getValue(RDC_SALON_LUMINOSITE, "illuminance_lux"));
if ($value == ON)
{
$illuminance = getValue(RDC_SALON_LUMINOSITE, "illuminance_lux");
logger(INFO, _("illuminance value : ") . $illuminance, __FILE__ . ":" . __LINE__);
if ($illuminance <= $this->luminance_min)
{
@@ -49,14 +49,14 @@ class rdc_salon_eclairage extends hook
if (getValue(RDC_SALON_MVMT, "occupancy") == OFF and (getValue(RDC_SALON_MVMT2, "occupancy") == OFF))
{
logger(INFO, _("Setting to OFF"), __FILE__ . ":" . __LINE__);
//setDelay($deviceTarget, $this->delay, $this->timeUnit, "state", "OFF", true);
$this->send($deviceTarget, "OFF", false, IDLE);
setDelay($deviceTarget, $this->delay, $this->timeUnit, "state", "OFF", true);
//$this->send($deviceTarget, "OFF", false, IDLE);
}
}
break;
case "contact":
logger(INFO, _("CASE: Contact Door"), __FILE__ . ":" . __LINE__);
if ($value == false and getValue(RDC_SALON_LUMINOSITE, "illuminance_lux") <= $this->luminance_min)
if ($value == false and $illuminance <= $this->luminance_min)
{
logger(INFO, _("Door is open and illumance < min"), __FILE__ . ":" . __LINE__);
if ($deviceTarget->properties["state"]["method"] !== MANUAL)