From b3f7171421386956bbb4083eb3d3b1708ae35ea5 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Tue, 21 Jun 2022 08:57:10 +0200 Subject: [PATCH] debug rdc_chambre_eclairage maintenant fonctionnel ... ou pas --- hooks/scripts/rdc_chambre_eclairage.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hooks/scripts/rdc_chambre_eclairage.php b/hooks/scripts/rdc_chambre_eclairage.php index 66f88f7..9b8b05b 100644 --- a/hooks/scripts/rdc_chambre_eclairage.php +++ b/hooks/scripts/rdc_chambre_eclairage.php @@ -24,20 +24,26 @@ class rdc_chambre_eclairage extends hook { global $devices, $indexDevices; logger(DEBUG, sprintf(_("property=%s, value=%s"), $property, $value), __FILE__ . ":" . __LINE__); - $lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"]; + $lux = $indexDevices[RDC_CHAMBRE_LUMINOSITE]->properties["illuminance_lux"]["value"]; $targetAmbiance = $indexDevices[RDC_CHAMBRE_AMBIANCE]; $targetEclairage = $indexDevices[RDC_CHAMBRE_ECLAIRAGE]; if ($property == "occupancy") { - if ($value == ON and $lux < 150) + logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__); + logger(DEBUG, "lux = " . bool2string($lux) . " luminance_min = " . $this->luminance_min, __FILE__ . ":" . __LINE__); + + if ($value === true and $lux < $this->luminance_min) { - logger(DEBUG, _("CASE: occupancy"), __FILE__ . ":" . __LINE__); + logger(DEBUG, _("lux < luminance_min"), __FILE__ . ":" . __LINE__); if ($targetAmbiance->properties["state"]["method"] == MANUAL) { + logger(DEBUG, _("method => MANUAL"), __FILE__ . ":" . __LINE__); + $method = false; $delayState = false; }else { + logger(DEBUG, _("method => AUTO"), __FILE__ . ":" . __LINE__); $method = AUTO; $delayState = "OFF"; }